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

Disable test suite for old async module

parent 438ed290
No related branches found
No related tags found
No related merge requests found
...@@ -5,34 +5,35 @@ import Control.Monad (void) ...@@ -5,34 +5,35 @@ import Control.Monad (void)
import Control.Monad.IO.Class import Control.Monad.IO.Class
import Prelude import Prelude
import Test.Hspec import Test.Hspec
import Quasar.Async --import Quasar.Async
import Quasar.Awaitable import Quasar.Awaitable
import Quasar.ResourceManager import Quasar.ResourceManager
import System.Timeout import System.Timeout
spec :: Spec spec :: Spec
spec = parallel $ do spec = describe "async" $ it "async" $ pendingWith "moving to new implementation..."
describe "async" $ do --spec = parallel $ do
it "can pass a value through async and await" $ do -- describe "async" $ do
withRootResourceManager (await =<< async (pure 42)) `shouldReturn` (42 :: Int) -- it "can pass a value through async and await" $ do
-- withRootResourceManager (await =<< async (pure 42)) `shouldReturn` (42 :: Int)
it "can pass a value through async and await" $ do --
withRootResourceManager (await =<< async (liftIO (threadDelay 100000) >> pure 42)) `shouldReturn` (42 :: Int) -- it "can pass a value through async and await" $ do
-- withRootResourceManager (await =<< async (liftIO (threadDelay 100000) >> pure 42)) `shouldReturn` (42 :: Int)
describe "await" $ do --
it "can await the result of an async that is completed later" $ do -- describe "await" $ do
avar <- newAsyncVar :: IO (AsyncVar ()) -- it "can await the result of an async that is completed later" $ do
void $ forkIO $ do -- avar <- newAsyncVar :: IO (AsyncVar ())
threadDelay 100000 -- void $ forkIO $ do
putAsyncVar_ avar () -- threadDelay 100000
await avar -- putAsyncVar_ avar ()
-- await avar
it "can fmap the result of an already finished async" $ do --
await (pure () :: Awaitable ()) :: IO () -- it "can fmap the result of an already finished async" $ do
-- await (pure () :: Awaitable ()) :: IO ()
it "can terminate when encountering an asynchronous exception" $ do --
never <- newAsyncVar :: IO (AsyncVar ()) -- it "can terminate when encountering an asynchronous exception" $ do
-- never <- newAsyncVar :: IO (AsyncVar ())
result <- timeout 100000 $ withRootResourceManager $ --
await never -- result <- timeout 100000 $ withRootResourceManager $
result `shouldBe` Nothing -- await never
-- result `shouldBe` Nothing
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