on master help sign in
Fix joinInnerMap test case failure
0a35315Ranjeet Kumar Ranjan
test/Streamly/Test/Prelude/Top.hs+7−4
@@ -1,6 +1,6 @@
1module Main (main) where
1module Main (main) where
2
2
3−import Data.List (sort)
3+import Data.List (nub, sort)
4import Test.QuickCheck
4import Test.QuickCheck
5 ( Gen
5 ( Gen
6 , Property
6 , Property
@@ -49,7 +49,10 @@ joinInnerMap :: Property
49joinInnerMap =
49joinInnerMap =
50 forAll (listOf (chooseInt (min_value, max_value))) $ \ls0 ->
50 forAll (listOf (chooseInt (min_value, max_value))) $ \ls0 ->
51 forAll (listOf (chooseInt (min_value, max_value))) $ \ls1 ->
51 forAll (listOf (chooseInt (min_value, max_value))) $ \ls1 ->
52− monadicIO $ action (map (\a -> (a,a)) ls0) (map (\a -> (a,a)) ls1)
52+ monadicIO $
53+ action
54+ (map (\a -> (a,a)) ls0)
55+ (map (\a -> (a,a)) ls1)
53
56
54 where
57 where
55
58
@@ -60,10 +63,10 @@ joinInnerMap =
60 $ Top.joinInnerMap (S.fromList ls0) (S.fromList ls1)
63 $ Top.joinInnerMap (S.fromList ls0) (S.fromList ls1)
61 let v2 = [
64 let v2 = [
62 (fst i, fst i, fst j)
65 (fst i, fst i, fst j)
63− | i <- ls0, j <- ls1
66+ | i <- ls0, j <- nub ls1
64 , fst i == fst j
67 , fst i == fst j
65 ]
68 ]
66− assert (v1 == v2)
69+ assert (sort v1 == sort v2)
67
70
68-------------------------------------------------------------------------------
71-------------------------------------------------------------------------------
69-- Main
72-- Main