Test generator: inner text content, assert= arg order fix

- Capture leaf element text content (e.g., <div>3</div> sets innerHTML "3")
- Fix assert= argument order: (actual expected) matches SX harness convention
- put: 17→19, empty: 6→4 (inner text reveals empty command not implemented)

402 → 403/831 (+1)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 23:34:25 +00:00
parent 429c2b59f9
commit e5293e4e03
2 changed files with 159 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -58,7 +58,9 @@ def parse_html(html):
stack.pop()
def handle_data(self, data):
pass
# Only capture text for top-level elements with no children
if stack and stack[-1]['depth'] == 0 and len(stack) == 1:
stack[-1]['inner'] += data.strip()
Parser().feed(html)
return elements
@@ -525,6 +527,9 @@ def emit_element_setup(lines, elements, var_names):
continue
aval_escaped = aval.replace('"', '\\"')
lines.append(f' (dom-set-attr {var} "{aname}" "{aval_escaped}")')
if el['inner']:
inner_escaped = el['inner'].replace('\\', '\\\\').replace('"', '\\"')
lines.append(f' (dom-set-inner-html {var} "{inner_escaped}")')
lines.append(f' (dom-append (dom-body) {var})')
if el['hs']:
lines.append(f' (hs-activate! {var})')