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
c3c90379
Commit
c3c90379
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add tests
parent
5c86ba46
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/Quasar/DisposableSpec.hs
+8
-1
8 additions, 1 deletion
test/Quasar/DisposableSpec.hs
test/Quasar/ObservableSpec.hs
+15
-4
15 additions, 4 deletions
test/Quasar/ObservableSpec.hs
with
23 additions
and
5 deletions
test/Quasar/DisposableSpec.hs
+
8
−
1
View file @
c3c90379
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
test/Quasar/ObservableSpec.hs
+
15
−
4
View file @
c3c90379
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
...
...
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