HS: breakpoint parse tests (+2 tests)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 12:57:02 +00:00
parent bb18c05083
commit 835fffb834
2 changed files with 13 additions and 2 deletions

View File

@@ -1134,9 +1134,11 @@
;; ── breakpoint (2 tests) ──
(defsuite "hs-upstream-breakpoint"
(deftest "parses as a top-level command"
(error "SKIP (untranslated): parses as a top-level command"))
(hs-compile "breakpoint")
)
(deftest "parses inside an event handler"
(error "SKIP (untranslated): parses inside an event handler"))
(hs-compile "on click breakpoint end")
)
)
;; ── call (6 tests) ──

View File

@@ -2551,6 +2551,15 @@ def generate_eval_only_test(test, idx):
hs_expr = extract_hs_expr(m.group(2))
assertions.append(f' (assert-throws (fn () (eval-hs "{hs_expr}")))')
# Pattern 4: error("expr").toBeNull() — parsing/eval must not throw
if not assertions:
for m in re.finditer(
r'error\((["\x27])(.+?)\1\).*?toBeNull\(\)',
body, re.DOTALL
):
hs_expr = extract_hs_expr(m.group(2))
assertions.append(f' (hs-compile "{hs_expr}")')
if not assertions:
return None # Can't convert this body pattern