File tree Expand file tree Collapse file tree 4 files changed +3
-13
lines changed
exercises/practice/nth-prime Expand file tree Collapse file tree 4 files changed +3
-13
lines changed Original file line number Diff line number Diff line change 3636
3737(defn nth-prime
3838 [n]
39- (if (zero? n)
40- (throw (IllegalArgumentException. " there is no zeroth prime" ))
41- (nth primes-seq (dec n))))
39+ (nth primes-seq (dec n)))
Original file line number Diff line number Diff line change 55{{#test_cases.prime }}
66(deftest nth-prime_test_{{idx}}
77 (testing {{context}}
8- {{~#if error}}
9- (is (thrown-with -msg? IllegalArgumentException #{{error}}
10- (nth-prime/nth-prime {{input.number }})))))
11- {{else }}
128 (is (= {{expected}} (nth-prime/nth-prime {{input.number }})))))
13- {{/if ~}}
149{{/test_cases.prime }}
Original file line number Diff line number Diff line change @@ -23,3 +23,5 @@ description = "big prime"
2323
2424[bd0a9eae-6df7-485b-a144-80e13c7d55b2 ]
2525description = " there is no zeroth prime"
26+ include = false
27+ comment = " excluded because we don't want to add error handling to the exercise"
Original file line number Diff line number Diff line change 1717(deftest nth-prime_test_4
1818 (testing " big prime"
1919 (is (= 104743 (nth-prime/nth-prime 10001 )))))
20-
21- (deftest nth-prime_test_5
22- (testing " there is no zeroth prime"
23- (is (thrown-with-msg? IllegalArgumentException #"^there is no zeroth prime$"
24- (nth-prime/nth-prime 0 )))))
You can’t perform that action at this time.
0 commit comments