From 90313d8f62db81439371fab256efbd0281230dd9 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Sat, 11 Jan 2025 14:25:10 +0100 Subject: [PATCH 1/2] scrabble-score: add generator and regenerate tests [no important files changed] --- .../scrabble-score/.meta/generator.tpl | 8 ++++ .../test/scrabble_score_test.clj | 44 +++++++++---------- generators/.problem-specifications | 1 + 3 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 exercises/practice/scrabble-score/.meta/generator.tpl create mode 160000 generators/.problem-specifications diff --git a/exercises/practice/scrabble-score/.meta/generator.tpl b/exercises/practice/scrabble-score/.meta/generator.tpl new file mode 100644 index 00000000..fccd5891 --- /dev/null +++ b/exercises/practice/scrabble-score/.meta/generator.tpl @@ -0,0 +1,8 @@ +(ns scrabble-score-test + (:require [clojure.test :refer [deftest testing is]] + scrabble-score)) +{{#test_cases.score}} +(deftest score-word_test_{{idx}} + (testing "{{description}}" + (is (= {{expected}} (scrabble-score/score-word "{{input.word}}"))))) +{{/test_cases.score}} \ No newline at end of file diff --git a/exercises/practice/scrabble-score/test/scrabble_score_test.clj b/exercises/practice/scrabble-score/test/scrabble_score_test.clj index 09a2f40c..1b9c4999 100644 --- a/exercises/practice/scrabble-score/test/scrabble_score_test.clj +++ b/exercises/practice/scrabble-score/test/scrabble_score_test.clj @@ -1,47 +1,47 @@ (ns scrabble-score-test (:require [clojure.test :refer [deftest testing is]] - scrabble-score)) + scrabble-score)) -(deftest lowercase-letter - (testing "Lowercase letter" +(deftest score-word_test_1 + (testing "lowercase letter" (is (= 1 (scrabble-score/score-word "a"))))) -(deftest uppercase-letter - (testing "Uppercase letter" +(deftest score-word_test_2 + (testing "uppercase letter" (is (= 1 (scrabble-score/score-word "A"))))) -(deftest valuable-letter - (testing "Valuable letter" +(deftest score-word_test_3 + (testing "valuable letter" (is (= 4 (scrabble-score/score-word "f"))))) -(deftest short-word - (testing "Short word" +(deftest score-word_test_4 + (testing "short word" (is (= 2 (scrabble-score/score-word "at"))))) -(deftest short-valuable-word - (testing "Short, valuable word" +(deftest score-word_test_5 + (testing "short, valuable word" (is (= 12 (scrabble-score/score-word "zoo"))))) -(deftest medium-word - (testing "Medium word" +(deftest score-word_test_6 + (testing "medium word" (is (= 6 (scrabble-score/score-word "street"))))) -(deftest medium-valuable-word +(deftest score-word_test_7 (testing "medium, valuable word" (is (= 22 (scrabble-score/score-word "quirky"))))) -(deftest long-mixed-case-word - (testing "Long, mixed-case word" +(deftest score-word_test_8 + (testing "long, mixed-case word" (is (= 41 (scrabble-score/score-word "OxyphenButazone"))))) -(deftest english-like-word - (testing "English-like word" +(deftest score-word_test_9 + (testing "english-like word" (is (= 8 (scrabble-score/score-word "pinata"))))) -(deftest empty-input - (testing "Empty input" +(deftest score-word_test_10 + (testing "empty input" (is (= 0 (scrabble-score/score-word ""))))) -(deftest entire-alphabet-available - (testing "Entire alphabet available" +(deftest score-word_test_11 + (testing "entire alphabet available" (is (= 87 (scrabble-score/score-word "abcdefghijklmnopqrstuvwxyz"))))) diff --git a/generators/.problem-specifications b/generators/.problem-specifications new file mode 160000 index 00000000..16289022 --- /dev/null +++ b/generators/.problem-specifications @@ -0,0 +1 @@ +Subproject commit 1628902256b883fb3237f5438f76e59db1a6fca0 From c82173834bd46c487b1f1c8d56c226ab6193f39f Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Sun, 12 Jan 2025 08:41:00 +0100 Subject: [PATCH 2/2] Update exercises/practice/scrabble-score/test/scrabble_score_test.clj Co-authored-by: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> --- exercises/practice/scrabble-score/.meta/generator.tpl | 4 ++-- .../practice/scrabble-score/test/scrabble_score_test.clj | 2 +- generators/.problem-specifications | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) delete mode 160000 generators/.problem-specifications diff --git a/exercises/practice/scrabble-score/.meta/generator.tpl b/exercises/practice/scrabble-score/.meta/generator.tpl index fccd5891..81c2569e 100644 --- a/exercises/practice/scrabble-score/.meta/generator.tpl +++ b/exercises/practice/scrabble-score/.meta/generator.tpl @@ -1,8 +1,8 @@ (ns scrabble-score-test (:require [clojure.test :refer [deftest testing is]] - scrabble-score)) + scrabble-score)) {{#test_cases.score}} (deftest score-word_test_{{idx}} (testing "{{description}}" (is (= {{expected}} (scrabble-score/score-word "{{input.word}}"))))) -{{/test_cases.score}} \ No newline at end of file +{{/test_cases.score~}} diff --git a/exercises/practice/scrabble-score/test/scrabble_score_test.clj b/exercises/practice/scrabble-score/test/scrabble_score_test.clj index 1b9c4999..c9573ccc 100644 --- a/exercises/practice/scrabble-score/test/scrabble_score_test.clj +++ b/exercises/practice/scrabble-score/test/scrabble_score_test.clj @@ -1,6 +1,6 @@ (ns scrabble-score-test (:require [clojure.test :refer [deftest testing is]] - scrabble-score)) + scrabble-score)) (deftest score-word_test_1 (testing "lowercase letter" diff --git a/generators/.problem-specifications b/generators/.problem-specifications deleted file mode 160000 index 16289022..00000000 --- a/generators/.problem-specifications +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1628902256b883fb3237f5438f76e59db1a6fca0