diff --git a/tests/playwright/generate-sx-tests.py b/tests/playwright/generate-sx-tests.py index f6025a85..14fb2123 100644 --- a/tests/playwright/generate-sx-tests.py +++ b/tests/playwright/generate-sx-tests.py @@ -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)