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

Add more resource manager tests (failing)

parent be85193c
No related branches found
No related tags found
No related merge requests found
...@@ -16,9 +16,7 @@ import Data.HashSet qualified as HS ...@@ -16,9 +16,7 @@ import Data.HashSet qualified as HS
import Data.Hashable qualified as Hashable import Data.Hashable qualified as Hashable
import Data.List qualified as List import Data.List qualified as List
import Data.Maybe qualified as Maybe import Data.Maybe qualified as Maybe
import GHC.Records.Compat (HasField, getField, setField)
import GHC.Stack.Types qualified import GHC.Stack.Types qualified
import GHC.TypeLits (Symbol)
import Quasar.Utils.ExtraT import Quasar.Utils.ExtraT
io :: IO a -> IO a io :: IO a -> IO a
......
...@@ -65,7 +65,20 @@ spec = parallel $ do ...@@ -65,7 +65,20 @@ spec = parallel $ do
liftIO $ throwIO TestException liftIO $ throwIO TestException
\TestException -> True \TestException -> True
it "handles an exception while disposing" $ io do
(`shouldThrow` \(_ :: CombinedException) -> True) do
withRootResourceManager do
registerDisposeAction $ throwIO TestException
liftIO $ threadDelay 100000
it "passes an exception to the root resource manager" $ io do it "passes an exception to the root resource manager" $ io do
(`shouldThrow` \(_ :: CombinedException) -> True) do
withRootResourceManager do
withSubResourceManagerM do
registerDisposeAction $ throwIO TestException
liftIO $ threadDelay 100000
it "passes an exception to the root resource manager when closing the inner resource manager first" $ io do
(`shouldThrow` \(_ :: CombinedException) -> True) do (`shouldThrow` \(_ :: CombinedException) -> True) do
withRootResourceManager do withRootResourceManager do
withSubResourceManagerM do withSubResourceManagerM 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