-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathis_integer.test.ts
42 lines (32 loc) · 1021 Bytes
/
is_integer.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { assertEquals } from "./deps.ts";
import { isInteger } from "./is_integer.ts";
Deno.test("Empty String is integer", () => {
assertEquals(isInteger(""), true);
});
Deno.test("Space is not integer", () => {
assertEquals(isInteger(" "), false);
});
Deno.test("Lowercase letters is not integer", () => {
assertEquals(isInteger("abcdefghijklmnopqrstuvwxyz"), false);
});
Deno.test("Uppercase letters is not integer", () => {
assertEquals(isInteger("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), false);
});
Deno.test("10 is integer", () => {
assertEquals(isInteger("10"), true);
});
Deno.test("10.0 is not integer", () => {
assertEquals(isInteger("10.0"), false);
});
Deno.test("-10 is not integer", () => {
assertEquals(isInteger("-10"), true);
});
Deno.test("-10.0 is not integer", () => {
assertEquals(isInteger("-10.0"), false);
});
Deno.test("10. is not integer", () => {
assertEquals(isInteger("10."), false);
});
Deno.test("10. is not integer", () => {
assertEquals(isInteger("-10."), false);
});