HS: hs-strip-order-deep + dict equality in assert-equal (+1 test)
hs-make-object appends _order for consistent key iteration (needed by repeat-in loops). But assert-equal (equal?) sees _order as a real key, breaking arrayLiteral "arrays containing objects work". Add hs-strip-order-deep to runtime.sx that recursively strips _order from dicts. Update emit_eval in the generator to wrap deep-dict evals with hs-strip-order-deep so assert-equal comparisons ignore _order. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3695,7 +3695,7 @@
|
||||
(assert= (eval-hs "[1 + 1, 2 * 3, 10 - 5]") (list 2 6 5))
|
||||
)
|
||||
(deftest "arrays containing objects work"
|
||||
(assert-equal (list {:a 1} {:b 2}) (eval-hs "[{a: 1}, {b: 2}]"))
|
||||
(assert-equal (list {:a 1} {:b 2}) (hs-strip-order-deep (eval-hs "[{a: 1}, {b: 2}]")))
|
||||
)
|
||||
(deftest "deeply nested array literals work"
|
||||
(assert= (eval-hs "[[[1]], [[2, 3]]]") (list (list (list 1)) (list (list 2 3))))
|
||||
|
||||
Reference in New Issue
Block a user