diff --git a/spec/tests/test-hyperscript-behavioral.sx b/spec/tests/test-hyperscript-behavioral.sx index 23f21cdf..4d9319e4 100644 --- a/spec/tests/test-hyperscript-behavioral.sx +++ b/spec/tests/test-hyperscript-behavioral.sx @@ -9242,7 +9242,12 @@ ;; ── on (70 tests) ── (defsuite "hs-upstream-on" (deftest "async basic finally blocks work" - (error "SKIP (skip-list): async basic finally blocks work")) + (hs-cleanup!) + (let ((_el-button (dom-create-element "button"))) + (dom-set-attr _el-button "_" "on click wait a tick then throw \"bar\" finally put \"bar\" into me") + (dom-append (dom-body) _el-button) + (hs-activate! _el-button) + )) (deftest "async exceptions don't kill the event queue" (hs-cleanup!) (let ((_el-button (dom-create-element "button"))) @@ -9251,11 +9256,26 @@ (hs-activate! _el-button) )) (deftest "async exceptions in finally block don't kill the event queue" - (error "SKIP (skip-list): async exceptions in finally block don't kill the event queue")) + (hs-cleanup!) + (let ((_el-button (dom-create-element "button"))) + (dom-set-attr _el-button "_" "on click increment :x finally then if :x is 1 then wait 1ms then throw \"bar\" otherwise then put \"success\" into me end") + (dom-append (dom-body) _el-button) + (hs-activate! _el-button) + )) (deftest "async finally blocks work when exception thrown in catch" - (error "SKIP (skip-list): async finally blocks work when exception thrown in catch")) + (hs-cleanup!) + (let ((_el-button (dom-create-element "button"))) + (dom-set-attr _el-button "_" "on click wait a tick then throw \"bar\" catch e set :foo to \"foo\" then throw e finally put :foo + \"bar\" into me") + (dom-append (dom-body) _el-button) + (hs-activate! _el-button) + )) (deftest "basic finally blocks work" - (error "SKIP (skip-list): basic finally blocks work")) + (hs-cleanup!) + (let ((_el-button (dom-create-element "button"))) + (dom-set-attr _el-button "_" "on click throw \"bar\" finally put \"bar\" into me") + (dom-append (dom-body) _el-button) + (hs-activate! _el-button) + )) (deftest "can be in a top level script tag" (error "SKIP (skip-list): can be in a top level script tag")) (deftest "can catch async top-level exceptions" @@ -9594,9 +9614,19 @@ (hs-activate! _el-button) )) (deftest "exceptions in finally block don't kill the event queue" - (error "SKIP (skip-list): exceptions in finally block don't kill the event queue")) + (hs-cleanup!) + (let ((_el-button (dom-create-element "button"))) + (dom-set-attr _el-button "_" "on click increment :x finally then if :x is 1 then throw \"bar\" otherwise then put \"success\" into me end") + (dom-append (dom-body) _el-button) + (hs-activate! _el-button) + )) (deftest "finally blocks work when exception thrown in catch" - (error "SKIP (skip-list): finally blocks work when exception thrown in catch")) + (hs-cleanup!) + (let ((_el-button (dom-create-element "button"))) + (dom-set-attr _el-button "_" "on click throw \"bar\" catch e throw e finally put \"bar\" into me") + (dom-append (dom-body) _el-button) + (hs-activate! _el-button) + )) (deftest "halt the event stops propagation to ancestors" (hs-cleanup!) (let ((_el-outer (dom-create-element "div")) (_el-inner (dom-create-element "button"))) diff --git a/tests/playwright/generate-sx-tests.py b/tests/playwright/generate-sx-tests.py index 0b58a92d..fd3c86fb 100644 --- a/tests/playwright/generate-sx-tests.py +++ b/tests/playwright/generate-sx-tests.py @@ -111,12 +111,6 @@ SKIP_TEST_NAMES = { "each behavior installation has its own event queue", "can catch exceptions thrown in js functions", "can catch exceptions thrown in hyperscript functions", - "basic finally blocks work", - "finally blocks work when exception thrown in catch", - "async basic finally blocks work", - "async finally blocks work when exception thrown in catch", - "async exceptions in finally block don't kill the event queue", - "exceptions in finally block don't kill the event queue", "can ignore when target doesn't exist", "can ignore when target doesn\\'t exist", "can handle an or after a from clause",