Added pred int-gt-n?

merge-requests/2/head
Clemens Geibel 2 years ago
parent 54d9836d49
commit 34f498cacb

@ -50,3 +50,8 @@
(every? true?
(map #(string? %) input))))
(defn int-gt-n?
[n input]
(and (int? input)
(> input n)))

@ -54,4 +54,12 @@
(deftest test-string-sequence?
(is (true? (cut/string-sequence? ["hallo" "welt" "!"])))
(is (false? (cut/string-sequence? ["hallo" 1 "welt" "!"])))
(is (false? (cut/string-sequence? "hallo welt!"))))
(is (false? (cut/string-sequence? "hallo welt!"))))
(deftest test-int-gt-n?
(is (not (cut/int-gt-n? 5 0)))
(is (not (cut/int-gt-n? 5 "s")))
(is (not (cut/int-gt-n? 0 0)))
(is (cut/int-gt-n? 5 6))
(is ((partial cut/int-gt-n? 5) 10))
(is (not ((partial cut/int-gt-n? 5) 4))))

Loading…
Cancel
Save