Skip to content
Snippets Groups Projects
Commit c3c90379 authored by Jens Nolte's avatar Jens Nolte
Browse files

Add tests

parent 5c86ba46
No related branches found
No related tags found
No related merge requests found
......@@ -88,11 +88,18 @@ spec = parallel $ do
attachDisposeAction_ resourceManager $ toAwaitable avar <$ putAsyncVar_ avar ()
pure () :: IO ()
it "re-throws an exception" $ do
shouldThrow
do
withResourceManager \_ ->
throwIO TestException
\TestException -> True
it "re-throws an exception from a dispose action" $ do
shouldThrow
do
withResourceManager \resourceManager ->
attachDisposeAction resourceManager $ throwIO $ TestException
attachDisposeAction resourceManager $ throwIO TestException
\TestException -> True
it "can attach an disposable that is disposed asynchronously" $ do
......
module Quasar.ObservableSpec (spec) where
import Quasar.Observable
import Control.Monad (void)
import Data.IORef
import Prelude
import Quasar.Prelude
import Quasar.Disposable
import Quasar.Observable
import Test.Hspec
spec :: Spec
spec = do
observableSpec
mergeObservableSpec
observableSpec :: Spec
observableSpec = parallel do
describe "Observable" do
it "works" $ io do
shouldReturn
do
withOnResourceManager do
observeWhile (pure () :: Observable ()) toObservableUpdate
()
mergeObservableSpec :: Spec
mergeObservableSpec = do
describe "mergeObservable" $ parallel $ do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment