Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit cdd695d

Browse files
committed
Add test for #63
1 parent 8460f3d commit cdd695d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/Test/Data/StrMap.purs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,12 @@ strMapTests = do
143143

144144
log "fromFoldable = zip keys values"
145145
quickCheck $ \(TestStrMap m) -> M.toList m == zipWith Tuple (fromFoldable $ M.keys m) (M.values m :: List Int)
146+
147+
log "Bug #63: accidental observable mutation in foldMap"
148+
quickCheck \(TestStrMap m) ->
149+
let lhs = go m
150+
rhs = go m
151+
in lhs == rhs <?> ("lhs: " <> show lhs <> ", rhs: " <> show rhs)
152+
where
153+
go :: M.StrMap (Array Ordering) -> Array Ordering
154+
go = M.foldMap \_ v -> v

0 commit comments

Comments
 (0)