Skip to content

Commit 280b2ea

Browse files
committed
Make sure strict folds force all the spine.
Not only the next few links, but any number of links. Even if an undefined link is very far, make sure it is still forced.
1 parent 2c1b7b4 commit 280b2ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/Properties.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ explosiveTail :: B -> B
249249
explosiveTail = (<> error "Tail of this byte string is undefined!")
250250

251251
prop_Lfoldr_lazy = \ xs -> genericTake (L.length xs) (L.foldr (:) [ ] (explosiveTail xs)) == L.unpack xs
252-
prop_Lfoldr'_strict = expectFailure $ \ xs -> genericTake (L.length xs) (L.foldr' (:) [ ] (explosiveTail xs)) == L.unpack xs
252+
prop_Lfoldr'_strict = expectFailure $ \ xs ys -> genericTake (L.length xs) (L.foldr' (:) [ ] (explosiveTail (xs <> ys))) == L.unpack xs
253253
prop_Lfoldr1_lazy = \ xs -> L.length xs > 0 ==> L.foldr1 const (explosiveTail (xs <> L.singleton 1)) == L.head xs
254-
prop_Lfoldr1'_strict = expectFailure $ \ xs -> L.length xs > 0 ==> L.foldr1' const (explosiveTail xs) == L.head xs
254+
prop_Lfoldr1'_strict = expectFailure $ \ xs ys -> L.length xs > 0 ==> L.foldr1' const (explosiveTail (xs <> ys)) == L.head xs
255255

256256
prop_unfoldrBP =
257257
forAll arbitrarySizedIntegral $

0 commit comments

Comments
 (0)