Skip to content

Commit

Permalink
UAdded test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
arghyadeep-k committed Aug 8, 2021
1 parent 6109acc commit 9a42da3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions mod_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import { assertEquals } from "./test_deps.ts";
import { validateTLD } from "./mod.ts";

Deno.test("Test with defaults", () => {
assertEquals(validateTLD("in"), true);
Deno.test("Test with lowercase input", () => {
const input = "in";
assertEquals(validateTLD(input), true);
});

Deno.test("Test with uppercase input", () => {
const input = "IN";
assertEquals(validateTLD(input), true);
});

Deno.test("Test with unhappy path", () => {
const input = "zebra";
assertEquals(validateTLD(input), false);
});

Deno.test("Test with happy path", () => {
const input = "PHOTOGRAPHY";
assertEquals(validateTLD(input), true);
});

0 comments on commit 9a42da3

Please sign in to comment.