diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/test/test/lux/control/thread.lux | 20 | ||||
-rw-r--r-- | stdlib/test/tests.lux | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/stdlib/test/test/lux/control/thread.lux b/stdlib/test/test/lux/control/thread.lux new file mode 100644 index 000000000..3dd27d0ad --- /dev/null +++ b/stdlib/test/test/lux/control/thread.lux @@ -0,0 +1,20 @@ +(.module: + lux + (lux (control [monad #+ do] + ["/" thread]))) + +(def: _test0_ + Nat + (/.run (do /.Monad<Thread> + [box (/.box +123) + old (/.update (n/* +2) box) + new (/.read box)] + (wrap (n/+ old new))))) + +(def: _test1_ + (All [!] (/.Thread ! Nat)) + (do /.Monad<Thread> + [box (/.box +123) + old (/.update (n/* +2) box) + new (/.read box)] + (wrap (n/+ old new)))) diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index ecce3d56b..87f9c913d 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -21,7 +21,8 @@ ["_." reader] ["_." writer] ["_." state] - ["_." parser]) + ["_." parser] + ["_." thread]) (data ["_." bit] ["_." bool] ["_." error] |