@@ -552,7 +552,7 @@ test_toDescList = toDescList (fromList [(5,"a"), (3,"b")]) @?= [(5,"a"), (3,"b")
552
552
test_showTree :: Assertion
553
553
test_showTree =
554
554
(let t = fromDistinctAscList [(x,() ) | x <- [1 .. 5 ]]
555
- in showTree t) @?= " * \n +--* \n | +-- 1:= ()\n | +--* \n | +-- 2:= ()\n | +-- 3:=() \n +--* \n +-- 4:= ()\n +-- 5:=() \n "
555
+ in showTree t) @?= " 1 () \n +--5 () \n | \n +--3 ()\n | | \n | +-. \n | | \n | +--2 ()\n | | \n | +-. \n | | \n | +-. \n | \n +--4 ()\n | \n +-. \n | \n +-. \n "
556
556
557
557
test_fromAscList :: Assertion
558
558
test_fromAscList = do
@@ -815,17 +815,9 @@ prop_withoutKeys m s0 = m `withoutKeys` s === filterWithKey (\k _ -> k `IntSet.n
815
815
s = keysSet s0
816
816
reduced = withoutKeys m s
817
817
818
- prop_mergeWithKeyModel :: [(Int ,Int )] -> [(Int ,Int )] -> Bool
819
- prop_mergeWithKeyModel xs ys
820
- = and [ testMergeWithKey f keep_x keep_y
821
- | f <- [ \ _k x1 _x2 -> Just x1
822
- , \ _k _x1 x2 -> Just x2
823
- , \ _k _x1 _x2 -> Nothing
824
- , \ k x1 x2 -> if k `mod` 2 == 0 then Nothing else Just (2 * x1 + 3 * x2)
825
- ]
826
- , keep_x <- [ True , False ]
827
- , keep_y <- [ True , False ]
828
- ]
818
+ prop_mergeWithKeyModel :: Fun (Int , Int , Int ) (Maybe Int ) -> Bool -> Bool -> [(Int ,Int )] -> [(Int ,Int )] -> Bool
819
+ prop_mergeWithKeyModel f keep_x keep_y xs ys
820
+ = testMergeWithKey (apply3 f) keep_x keep_y
829
821
830
822
where xs' = List. nubBy ((==) `on` fst ) xs
831
823
ys' = List. nubBy ((==) `on` fst ) ys
0 commit comments