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:
@@ -2570,10 +2570,10 @@ def generate_eval_only_test(test, idx):
|
||||
f'(list (quote {n}) {v})' for n, v in pairs
|
||||
) + ')'
|
||||
if use_deep:
|
||||
return f' (assert-equal {expected_sx} (eval-hs-locals "{hs_expr}" {locals_sx}))'
|
||||
return f' (assert-equal {expected_sx} (hs-strip-order-deep (eval-hs-locals "{hs_expr}" {locals_sx})))'
|
||||
return f' (assert= (eval-hs-locals "{hs_expr}" {locals_sx}) {expected_sx})'
|
||||
if use_deep:
|
||||
return f' (assert-equal {expected_sx} (eval-hs "{hs_expr}"))'
|
||||
return f' (assert-equal {expected_sx} (hs-strip-order-deep (eval-hs "{hs_expr}")))'
|
||||
return f' (assert= (eval-hs "{hs_expr}") {expected_sx})'
|
||||
|
||||
# Shared sub-pattern for run() call with optional String.raw and extra args:
|
||||
|
||||
Reference in New Issue
Block a user