Skip to content

Commit 709b255

Browse files
committed
Add test for stack-safety of replicateM
1 parent a739b20 commit 709b255

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/Test/Data/Array.purs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ testArray = do
3131
assert $ replicateM 0 (Just 1) == Just []
3232
assert $ replicateM (-1) (Just 1) == Just []
3333

34+
log "replicateM should be stack safe"
35+
let n = 50000
36+
assert $ replicateM n (Just unit) == Just (replicate n unit)
37+
3438
-- some
3539
-- many
3640

0 commit comments

Comments
 (0)