Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use string helper in templates #748

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions exercises/practice/difference-of-squares/.meta/generator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
difference-of-squares))
{{#test_cases.squareOfSum}}
(deftest square-of-sum_test_{{idx}}
(testing "{{description}}"
(testing {{string description}}
(is (= {{expected}} (difference-of-squares/square-of-sum {{input.number}})))))
{{/test_cases.squareOfSum~}}
{{#test_cases.sumOfSquares}}
(deftest sum-of-squares_test_{{idx}}
(testing "{{description}}"
(testing {{string description}}
(is (= {{expected}} (difference-of-squares/sum-of-squares {{input.number}})))))
{{/test_cases.sumOfSquares~}}
{{#test_cases.differenceOfSquares}}
(deftest difference_test_{{idx}}
(testing "{{description}}"
(testing {{string description}}
(is (= {{expected}} (difference-of-squares/difference {{input.number}})))))
{{/test_cases.differenceOfSquares~}}
4 changes: 2 additions & 2 deletions exercises/practice/isogram/.meta/generator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
isogram))
{{#test_cases.isIsogram}}
(deftest isogram?_test_{{idx}}
(testing "{{description}}"
(is ({{#expected~}}true?{{else}}false?{{/expected}} (isogram/isogram? "{{input.phrase}}")))))
(testing {{string description}}
(is ({{#expected~}}true?{{else}}false?{{/expected}} (isogram/isogram? {{string input.phrase}})))))
{{/test_cases.isIsogram~}}
2 changes: 1 addition & 1 deletion exercises/practice/pangram/.meta/generator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
pangram))
{{#test_cases.isPangram}}
(deftest pangram?_test_{{idx}}
(testing "{{description}}"
(testing {{string description}}
(is ({{#expected}}true?{{else}}false?{{/expected}} (pangram/pangram? {{string input.sentence}})))))
{{/test_cases.isPangram~}}
4 changes: 2 additions & 2 deletions exercises/practice/roman-numerals/.meta/generator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
roman-numerals))
{{#test_cases.roman}}
(deftest numerals_test_{{idx}}
(testing "{{description}}"
(is (= "{{expected}}" (roman-numerals/numerals {{input.number}})))))
(testing {{string description}}
(is (= {{string expected}} (roman-numerals/numerals {{input.number}})))))
{{/test_cases.roman~}}
4 changes: 2 additions & 2 deletions exercises/practice/scrabble-score/.meta/generator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
scrabble-score))
{{#test_cases.score}}
(deftest score-word_test_{{idx}}
(testing "{{description}}"
(is (= {{expected}} (scrabble-score/score-word "{{input.word}}")))))
(testing {{string description}}
(is (= {{expected}} (scrabble-score/score-word {{string input.word}})))))
{{/test_cases.score~}}
4 changes: 2 additions & 2 deletions exercises/practice/two-fer/.meta/generator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
two-fer))
{{#test_cases.twoFer}}
(deftest two-fer_test_{{idx}}
(testing "{{description}}"
(is (= "{{expected}}" (two-fer/two-fer{{#input.name}} "{{input.name}}"{{/input.name}})))))
(testing {{string description}}
(is (= {{string expected}} (two-fer/two-fer{{#input.name}} {{string input.name}}{{/input.name}})))))
{{/test_cases.twoFer~}}