Skip to content

Commit

Permalink
two-fer: add generator and regenerate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Jan 11, 2025
1 parent b866e68 commit a81cbea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
8 changes: 8 additions & 0 deletions exercises/practice/two-fer/.meta/generator.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(ns two-fer-test
(:require [clojure.test :refer [deftest testing is]]
two-fer))
{{#test_cases.twoFer}}
(deftest two-fer_test_{{idx}}
(testing "{{description}}"
(is (= "{{expected}}" (two-fer/two-fer{{#input.name}} "{{input.name}}"{{/input.name}})))))
{{/test_cases.twoFer}}
20 changes: 12 additions & 8 deletions exercises/practice/two-fer/test/two_fer_test.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
(ns two-fer-test
(:require [clojure.test :refer [deftest is]]
two-fer))
(:require [clojure.test :refer [deftest testing is]]
two-fer))

(deftest two-fer-test
(is (= "One for you, one for me." (two-fer/two-fer))))
(deftest two-fer_test_1
(testing "no name given"
(is (= "One for you, one for me." (two-fer/two-fer)))))

(deftest name-alice-test
(is (= "One for Alice, one for me." (two-fer/two-fer "Alice"))))
(deftest two-fer_test_2
(testing "a name given"
(is (= "One for Alice, one for me." (two-fer/two-fer "Alice")))))

(deftest two-fer_test_3
(testing "another name given"
(is (= "One for Bob, one for me." (two-fer/two-fer "Bob")))))

(deftest name-bob-test
(is (= "One for Bob, one for me." (two-fer/two-fer "Bob"))))

0 comments on commit a81cbea

Please sign in to comment.