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:
2026-05-05 05:00:40 +00:00
parent 7190a8b1d2
commit 6d534e8c42
3 changed files with 25 additions and 5 deletions

View File

@@ -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: