Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar
Commits
d2802680
Commit
d2802680
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Disable test suite for old async module
parent
438ed290
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/Quasar/AsyncSpec.hs
+27
-26
27 additions, 26 deletions
test/Quasar/AsyncSpec.hs
with
27 additions
and
26 deletions
test/Quasar/AsyncSpec.hs
+
27
−
26
View file @
d2802680
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment