HS test generator: flatten whitespace in toEqual({...}) TODO comment
The Pattern 1c emitter wrote `;; TODO: assert= ... against {...}` for
object-literal .toEqual() assertions it couldn't translate. It only
.strip()'d the literal, leaving internal newlines intact — so a
multi-line `{...}` leaked SX-invalid text onto subsequent lines and
broke the parse for the rest of the suite.
Collapse all whitespace inside the literal so the `;;` prefix covers the
whole comment.
After regenerating, 1,022/1,496 pass (was 1,013/1,496 with a hand-
patched behavioral.sx). No runtime changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1072,8 +1072,11 @@ def generate_eval_only_test(test, idx):
|
||||
body, re.DOTALL
|
||||
):
|
||||
hs_expr = extract_hs_expr(m.group(2))
|
||||
# Object toEqual — emit as dict assertion comment (can't fully convert JS objects to SX)
|
||||
obj_str = m.group(3).strip()
|
||||
# Object toEqual — emit as single-line TODO comment. Collapse
|
||||
# whitespace inside the JS literal so the `;;` prefix covers the
|
||||
# whole line; a multi-line `{...}` would leak SX-invalid text
|
||||
# onto subsequent lines and break the parse.
|
||||
obj_str = re.sub(r'\s+', ' ', m.group(3)).strip()
|
||||
assertions.append(f' ;; TODO: assert= (eval-hs "{hs_expr}") against {obj_str}')
|
||||
|
||||
# Pattern 2: Two-line — var result = await run(`expr`, opts); expect(result...).toBe/toEqual(val)
|
||||
|
||||
Reference in New Issue
Block a user