Added pred int-gt-n?
This commit is contained in:
parent
54d9836d49
commit
34f498cacb
2 changed files with 14 additions and 1 deletions
|
@ -50,3 +50,8 @@
|
|||
(every? true?
|
||||
(map #(string? %) input))))
|
||||
|
||||
(defn int-gt-n?
|
||||
[n input]
|
||||
(and (int? input)
|
||||
(> input n)))
|
||||
|
||||
|
|
|
@ -55,3 +55,11 @@
|
|||
(is (true? (cut/string-sequence? ["hallo" "welt" "!"])))
|
||||
(is (false? (cut/string-sequence? ["hallo" 1 "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…
Reference in a new issue