fix: case composite constants, associative?/reversible?, update non-fn args, nth nil
- case: quote list literals (read as arrays) in constant position so a wrapped list ((a b c)) matches by value instead of being evaluated as a call; symbol constants already quoted. Vector/map/set constants already worked. case errors in the suite drop to 0 (60 pass). - associative?: true only for vectors (pvec) and maps (phm/struct/sorted-map), not lists/tuples-from-seq-fns/lazy-seqs/sets. - reversible?: true for vectors and sorted-map/sorted-set only. - update: coerce f via as-fn so (update m k :kw)/(update m k a-set) work; extra args already handled. - nth: (nth nil i)/(nth nil i default) returns nil/default instead of throwing. clojure-test-suite pass 3649->3678, errors 122->105, clean files 44->46. associative?/reversible? files now fully clean. spec: predicates + control/case. jpm test green.
This commit is contained in:
parent
2ccfa675f7
commit
bcdace7543
4 changed files with 28 additions and 7 deletions
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
# Baseline: assertions Jolt currently passes across the suite. Raise as Jolt
|
||||
# improves so a regression (previously-passing assertion breaking) is caught.
|
||||
(def baseline-pass 3600)
|
||||
(def baseline-pass 3660)
|
||||
# A file is "clean" when it ran with zero failures AND zero errors.
|
||||
(def baseline-clean-files 43)
|
||||
(def baseline-clean-files 45)
|
||||
# Per-file wall-clock budget (seconds). Normal files finish in well under 1s;
|
||||
# this only fires on infinite-sequence hangs.
|
||||
(def per-file-timeout 6)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,12 @@
|
|||
["condp" "\"two\"" "(condp = 2 1 \"one\" 2 \"two\" \"other\")"]
|
||||
["case" ":b" "(case 2 1 :a 2 :b :default)"]
|
||||
["case default" ":d" "(case 9 1 :a 2 :b :d)"]
|
||||
["case multi" ":ab" "(case 2 (1 2) :ab 3 :c)"])
|
||||
["case multi" ":ab" "(case 2 (1 2) :ab 3 :c)"]
|
||||
["case symbol const" ":s" "(case 'foo foo :s :default)"]
|
||||
["case vector const" ":v" "(case [1 2] [1 2] :v :default)"]
|
||||
["case map const" ":m" "(case {:a 1} {:a 1} :m :default)"]
|
||||
["case list const" ":l" "(case '(a b) (quote (a b)) :l :default)"]
|
||||
["case keyword" ":k" "(case :x :x :k :default)"])
|
||||
|
||||
(defspec "control / logic"
|
||||
["and all true" "3" "(and 1 2 3)"]
|
||||
|
|
|
|||
|
|
@ -34,6 +34,12 @@
|
|||
["sequential? vector" "true" "(sequential? [1])"]
|
||||
["associative? map" "true" "(associative? {:a 1})"]
|
||||
["associative? vec" "true" "(associative? [1])"]
|
||||
["associative? list" "false" "(associative? '(1 2))"]
|
||||
["associative? set" "false" "(associative? #{1})"]
|
||||
["reversible? vec" "true" "(reversible? [1 2])"]
|
||||
["reversible? list" "false" "(reversible? '(1 2))"]
|
||||
["reversible? smap" "true" "(reversible? (sorted-map :a 1))"]
|
||||
["reversible? hmap" "false" "(reversible? (hash-map :a 1))"]
|
||||
["indexed? vector" "true" "(indexed? [1])"]
|
||||
["counted? vector" "true" "(counted? [1])"])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue