HS Bucket F: fix hs-make-object _order + assert= for dicts (+1 test)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 20s

hs-make-object no longer appends _order to every HS object literal.
Generator emit_eval now uses assert-equal (equal?) for dict-containing
expected values instead of assert= (= reference equality).
Together these fix arrayLiteral "arrays containing objects work".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 15:22:26 +00:00
parent 11917f1bfa
commit daea280837
4 changed files with 15 additions and 30 deletions

View File

@@ -2067,13 +2067,20 @@ def generate_eval_only_test(test, idx):
def emit_eval(hs_expr, expected_sx, extra_locals=None):
"""Emit an assertion using eval-hs / eval-hs-locals / eval-hs-with-me
as appropriate, given the window setups and any per-call locals.
Uses assert-equal (deep equal?) when expected contains dicts; assert= otherwise.
"""
pairs = list(window_setups) + list(extra_locals or [])
# assert= uses = (reference equality for dicts); assert-equal uses equal? (deep)
use_deep = '{' in expected_sx
if pairs:
locals_sx = '(list ' + ' '.join(
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= (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= (eval-hs "{hs_expr}") {expected_sx})'
# Shared sub-pattern for run() call with optional String.raw and extra args: