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:
@@ -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")))',
|
||||
|
||||
Reference in New Issue
Block a user