Skip to content

Commit 750a785

Browse files
Add isogram template
1 parent c1bdb95 commit 750a785

File tree

4 files changed

+64
-21
lines changed

4 files changed

+64
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(ns isogram-test
2-
(:require [clojure.test :refer [deftest testing is]]
2+
(:require [clojure.test :refer [deftest testing is]]
33
isogram))
44
{% for test_case in test_cases %}
55
(deftest isogram_test_{{forloop.counter}}
6-
(testing "{{test_case.path|join:" - "}}")
7-
{% if test_case.expected %}(is (isogram/isogram? "{{test_case.input.phrase}}"))) {% else %}(is (not (isogram/isogram? "{{test_case.input.phrase}}")))) {% endif %}
6+
(testing "{{test_case.path|join:" - "}}"
7+
{% if test_case.expected %}(is (isogram/isogram? "{{test_case.input.phrase}}")))) {% else %}(is (not (isogram/isogram? "{{test_case.input.phrase}}")))){% endif %}
88
{% endfor %}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,60 @@
11
(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+

exercises/practice/two-fer/.meta/generator.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(ns two-fer-test
2-
(:require [clojure.test :refer [deftest testing is]]
2+
(:require [clojure.test :refer [deftest testing is]]
33
two-fer))
44
{% for test_case in test_cases %}
55
(deftest two-fer_test_{{forloop.counter}}

exercises/practice/two-fer/test/two_fer_test.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(ns two-fer-test
2-
(:require [clojure.test :refer [deftest testing is]]
2+
(:require [clojure.test :refer [deftest testing is]]
33
two-fer))
44

55
(deftest two-fer_test_1

0 commit comments

Comments
 (0)