Skip to content

Commit 25a34f0

Browse files
scrabble-score: update to latest (#737)
* scrabble-score: add generator and regenerate tests [no important files changed] * Update exercises/practice/scrabble-score/test/scrabble_score_test.clj Co-authored-by: Anastasios Chatzialexiou <[email protected]> --------- Co-authored-by: Anastasios Chatzialexiou <[email protected]>
1 parent 5c28e85 commit 25a34f0

File tree

3 files changed

+34
-28
lines changed

3 files changed

+34
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(ns scrabble-score-test
2+
(:require [clojure.test :refer [deftest testing is]]
3+
scrabble-score))
4+
{{#test_cases.score}}
5+
(deftest score-word_test_{{idx}}
6+
(testing "{{description}}"
7+
(is (= {{expected}} (scrabble-score/score-word "{{input.word}}")))))
8+
{{/test_cases.score~}}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
(ns scrabble-score)
22

3-
(defn score-letter [] ;; <- arglist goes here
4-
;; your code goes here
5-
)
6-
7-
(defn score-word [] ;; <- arglist goes here
8-
;; your code goes here
9-
)
3+
(defn score-word
4+
"Calculate a word's scrabble score"
5+
[word]
6+
;; function body
7+
)

exercises/practice/scrabble-score/test/scrabble_score_test.clj

+21-21
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22
(:require [clojure.test :refer [deftest testing is]]
33
scrabble-score))
44

5-
(deftest lowercase-letter
6-
(testing "Lowercase letter"
5+
(deftest score-word_test_1
6+
(testing "lowercase letter"
77
(is (= 1 (scrabble-score/score-word "a")))))
88

9-
(deftest uppercase-letter
10-
(testing "Uppercase letter"
9+
(deftest score-word_test_2
10+
(testing "uppercase letter"
1111
(is (= 1 (scrabble-score/score-word "A")))))
1212

13-
(deftest valuable-letter
14-
(testing "Valuable letter"
13+
(deftest score-word_test_3
14+
(testing "valuable letter"
1515
(is (= 4 (scrabble-score/score-word "f")))))
1616

17-
(deftest short-word
18-
(testing "Short word"
17+
(deftest score-word_test_4
18+
(testing "short word"
1919
(is (= 2 (scrabble-score/score-word "at")))))
2020

21-
(deftest short-valuable-word
22-
(testing "Short, valuable word"
21+
(deftest score-word_test_5
22+
(testing "short, valuable word"
2323
(is (= 12 (scrabble-score/score-word "zoo")))))
2424

25-
(deftest medium-word
26-
(testing "Medium word"
25+
(deftest score-word_test_6
26+
(testing "medium word"
2727
(is (= 6 (scrabble-score/score-word "street")))))
2828

29-
(deftest medium-valuable-word
29+
(deftest score-word_test_7
3030
(testing "medium, valuable word"
3131
(is (= 22 (scrabble-score/score-word "quirky")))))
3232

33-
(deftest long-mixed-case-word
34-
(testing "Long, mixed-case word"
33+
(deftest score-word_test_8
34+
(testing "long, mixed-case word"
3535
(is (= 41 (scrabble-score/score-word "OxyphenButazone")))))
3636

37-
(deftest english-like-word
38-
(testing "English-like word"
37+
(deftest score-word_test_9
38+
(testing "english-like word"
3939
(is (= 8 (scrabble-score/score-word "pinata")))))
4040

41-
(deftest empty-input
42-
(testing "Empty input"
41+
(deftest score-word_test_10
42+
(testing "empty input"
4343
(is (= 0 (scrabble-score/score-word "")))))
4444

45-
(deftest entire-alphabet-available
46-
(testing "Entire alphabet available"
45+
(deftest score-word_test_11
46+
(testing "entire alphabet available"
4747
(is (= 87 (scrabble-score/score-word "abcdefghijklmnopqrstuvwxyz")))))

0 commit comments

Comments
 (0)