on master help sign in
Add a test for "each" to test multiple threads
commit8a1d5d995ede2d95c769f47ebf9bfec486b9c78b authorHarendra Kumar <harendra.kumar@gmail.com> dateWed 16 Aug 2017, 14:53 (9 years ago) parent550eed4
1 file changed+2
test/Main.hs+2
test/Main.hs+2
@@ -28,6 +28,8 @@ main = hspec $ do
2828 toList (return 0 <> return 1) `shouldReturn` ([0, 1] :: [Int])
2929 it "Alternative composition" $
3030 ((toList $ (return 0 <|> return 1)) >>= return . sort) `shouldReturn` ([0, 1] :: [Int])
31+ it "Alternative composition - each" $
32+ ((toList $ each [1..100]) >>= return . sort) `shouldReturn` ([1..100] :: [Int])
3133 {-
3234 it "Alternative composition of async and sync tasks" $
3335 ((wait (threads 0 ((async (return 0) <|> return 1)))) >>= return . sort)