Skip to content

Commit

Permalink
Add failing test for purescript-contrib#174
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Schlitter committed May 20, 2019
1 parent 390857f commit b9feedd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/Test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,26 @@ test_regression_kill_empty_supervisor = assert "regression/kill-empty-supervisor
b = parallel $ delay (Milliseconds 20.0) $> false
sequential (a <|> b)

test_interruptible_completes Aff Unit
test_interruptible_completes = assert "test/interruptible-completes" do
ref ← newRef Nothing
f1 ← forkAff $
generalBracket
(pure unit)
{ killed: \_ _ -> writeRef ref (Just "killed")
, failed: \_ _ -> writeRef ref (Just "failed")
, completed: \_ _ -> writeRef ref (Just "completed")
}
(\_ ->
bracket
(delay (Milliseconds 20.0))
(const (pure unit))
pure
)
delay (Milliseconds 10.0)
killFiber (error "kaboom.") f1
readRef ref <#> (_ == Just "completed")

main Effect Unit
main = do
test_pure
Expand Down Expand Up @@ -781,3 +801,4 @@ main = do
test_regression_kill_sync_async
test_regression_bracket_kill_mask
test_regression_kill_empty_supervisor
test_interruptible_completes

0 comments on commit b9feedd

Please sign in to comment.