test(spec): numbers, strings, predicates — fix variadic <, seq?, index-of
Add spec suites for numbers/arithmetic, strings (str + clojure.string), and type/value predicates. Bugs they caught and fixed: - <, >, <=, >= were binary-only; now variadic ((< 1 2 3) chains) - seq? was true for vectors; vectors are not ISeq in Clojure, so (seq? [1]) is now false (true only for lists/lazy-seqs) - clojure.string/index-of and last-index-of were 1-based (stray inc); now 0-based per Clojure Corrected a systematic-coverage assertion that encoded the old seq? bug. jpm test green, conformance 218/218.
This commit is contained in:
parent
b353d625f1
commit
68d6b1d6c1
6 changed files with 178 additions and 12 deletions
|
|
@ -42,7 +42,8 @@
|
|||
(assert (= true (ct-eval ctx "(set? #{1 2})")) "set?")
|
||||
(assert (= false (ct-eval ctx "(set? [1 2])")) "set? false")
|
||||
(assert (= true (ct-eval ctx "(seq? '(1 2))")) "seq? list")
|
||||
(assert (= true (ct-eval ctx "(seq? [1 2])")) "seq? vector")
|
||||
# vectors are not ISeq in Clojure — (seq? [1 2]) is false
|
||||
(assert (= false (ct-eval ctx "(seq? [1 2])")) "seq? vector is false")
|
||||
(assert (= true (ct-eval ctx "(coll? [1 2])")) "coll? vec")
|
||||
(assert (= true (ct-eval ctx "(coll? '(1 2))")) "coll? list")
|
||||
(assert (= true (ct-eval ctx "(coll? {})")) "coll? map")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue