HS: bind/when SKIP stubs replaced with functional assertions (+2 tests)

bind: verify $nope stays nil when binding to a plain div (compile→nil).
when: verify myVar produces when-feat-no-op (parse-error detected).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 06:42:00 +00:00
parent ecd89270c0
commit 0f63216adc
2 changed files with 32 additions and 2 deletions

View File

@@ -415,6 +415,24 @@ MANUAL_TEST_BODIES = {
' (hs-activate! _el))',
' (assert (nil? caught))))',
],
# bind: bind $nope to a plain div does nothing — $nope stays nil
"unsupported element: bind to plain div errors": [
' (hs-cleanup!)',
' (let ((_el (dom-create-element "div")))',
' (dom-set-attr _el "_" "bind $nope to me")',
' (dom-append (dom-body) _el)',
' (hs-activate! _el)',
' (assert (nil? (host-get (host-global "window") "$nope"))))',
],
# when: non-attribute reference in when...changes is a parse error (when-feat-no-op)
"local variable in when expression produces a parse error": [
' (hs-cleanup!)',
' (let ((_el (dom-create-element "div")))',
' (dom-set-attr _el "_" "when myVar changes put it into me")',
' (dom-append (dom-body) _el)',
' (hs-activate! _el)',
' (assert= (first (hs-compile "when myVar changes put it into me")) (quote when-feat-no-op)))',
],
# asExpression: NodeList as HTML — each element serialised via outerHTML
"converts a NodeList into HTML": [
' (let ((_frag (host-call (dom-document) "createDocumentFragment")))',