|
1 | 1 | (ns isogram-test
|
2 |
| - (:require [clojure.test :refer [deftest is]] |
3 |
| - isogram)) |
4 |
| - |
5 |
| -(deftest test-isograms |
6 |
| - (is (isogram/isogram? "duplicates")) |
7 |
| - (is (isogram/isogram? "subdermatoglyphic")) |
8 |
| - (is (isogram/isogram? "thumbscrew-japingly")) |
9 |
| - (is (isogram/isogram? "Hjelmqvist-Gryb-Zock-Pfund-Wax")) |
10 |
| - (is (isogram/isogram? "Heizölrückstoßabdämpfung")) |
11 |
| - (is (isogram/isogram? "Emily Jung Schwartzkopf"))) |
12 |
| - |
13 |
| -(deftest test-non-isograms |
14 |
| - (is (not (isogram/isogram? "eleven"))) |
15 |
| - (is (not (isogram/isogram? "Alphabet"))) |
16 |
| - (is (not (isogram/isogram? "the quick brown fox"))) |
17 |
| - (is (not (isogram/isogram? "éléphant")))) |
| 2 | + (:require [clojure.test :refer [deftest testing is]] |
| 3 | + isogram)) |
| 4 | + |
| 5 | +(deftest isogram_test_1 |
| 6 | + (testing "empty string" |
| 7 | + (is (isogram/isogram? "")))) |
| 8 | + |
| 9 | +(deftest isogram_test_2 |
| 10 | + (testing "isogram with only lower case characters" |
| 11 | + (is (isogram/isogram? "isogram")))) |
| 12 | + |
| 13 | +(deftest isogram_test_3 |
| 14 | + (testing "word with one duplicated character" |
| 15 | + (is (not (isogram/isogram? "eleven")))) |
| 16 | + |
| 17 | +(deftest isogram_test_4 |
| 18 | + (testing "word with one duplicated character from the end of the alphabet" |
| 19 | + (is (not (isogram/isogram? "zzyzx")))) |
| 20 | + |
| 21 | +(deftest isogram_test_5 |
| 22 | + (testing "longest reported english isogram" |
| 23 | + (is (isogram/isogram? "subdermatoglyphic")))) |
| 24 | + |
| 25 | +(deftest isogram_test_6 |
| 26 | + (testing "word with duplicated character in mixed case" |
| 27 | + (is (not (isogram/isogram? "Alphabet")))) |
| 28 | + |
| 29 | +(deftest isogram_test_7 |
| 30 | + (testing "word with duplicated character in mixed case, lowercase first" |
| 31 | + (is (not (isogram/isogram? "alphAbet")))) |
| 32 | + |
| 33 | +(deftest isogram_test_8 |
| 34 | + (testing "hypothetical isogrammic word with hyphen" |
| 35 | + (is (isogram/isogram? "thumbscrew-japingly")))) |
| 36 | + |
| 37 | +(deftest isogram_test_9 |
| 38 | + (testing "hypothetical word with duplicated character following hyphen" |
| 39 | + (is (not (isogram/isogram? "thumbscrew-jappingly")))) |
| 40 | + |
| 41 | +(deftest isogram_test_10 |
| 42 | + (testing "isogram with duplicated hyphen" |
| 43 | + (is (isogram/isogram? "six-year-old")))) |
| 44 | + |
| 45 | +(deftest isogram_test_11 |
| 46 | + (testing "made-up name that is an isogram" |
| 47 | + (is (isogram/isogram? "Emily Jung Schwartzkopf")))) |
| 48 | + |
| 49 | +(deftest isogram_test_12 |
| 50 | + (testing "duplicated character in the middle" |
| 51 | + (is (not (isogram/isogram? "accentor")))) |
| 52 | + |
| 53 | +(deftest isogram_test_13 |
| 54 | + (testing "same first and last characters" |
| 55 | + (is (not (isogram/isogram? "angola")))) |
| 56 | + |
| 57 | +(deftest isogram_test_14 |
| 58 | + (testing "word with duplicated character and with two hyphens" |
| 59 | + (is (not (isogram/isogram? "up-to-date")))) |
| 60 | + |
0 commit comments