From d280268076acfedde70ab0ffe878bf14d71af186 Mon Sep 17 00:00:00 2001 From: Jens Nolte <git@queezle.net> Date: Sat, 12 Feb 2022 01:21:12 +0100 Subject: [PATCH] Disable test suite for old async module --- test/Quasar/AsyncSpec.hs | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/test/Quasar/AsyncSpec.hs b/test/Quasar/AsyncSpec.hs index fd5a614..625e2c4 100644 --- a/test/Quasar/AsyncSpec.hs +++ b/test/Quasar/AsyncSpec.hs @@ -5,34 +5,35 @@ import Control.Monad (void) import Control.Monad.IO.Class import Prelude import Test.Hspec -import Quasar.Async +--import Quasar.Async import Quasar.Awaitable import Quasar.ResourceManager import System.Timeout spec :: Spec -spec = parallel $ do - describe "async" $ do - 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) - - describe "await" $ do - it "can await the result of an async that is completed later" $ do - avar <- newAsyncVar :: IO (AsyncVar ()) - void $ forkIO $ do - threadDelay 100000 - putAsyncVar_ avar () - await avar - - 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 ()) - - result <- timeout 100000 $ withRootResourceManager $ - await never - result `shouldBe` Nothing +spec = describe "async" $ it "async" $ pendingWith "moving to new implementation..." +--spec = parallel $ do +-- describe "async" $ do +-- 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) +-- +-- describe "await" $ do +-- it "can await the result of an async that is completed later" $ do +-- avar <- newAsyncVar :: IO (AsyncVar ()) +-- void $ forkIO $ do +-- threadDelay 100000 +-- putAsyncVar_ avar () +-- await avar +-- +-- 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 ()) +-- +-- result <- timeout 100000 $ withRootResourceManager $ +-- await never +-- result `shouldBe` Nothing -- GitLab