@@ -1079,6 +1079,9 @@ test_updateMin = do
10791079 updateMin (\ a -> Just (" X" ++ a)) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= fromList [(- 3 , " Xb" ), (5 , " a" )]
10801080 updateMin (\ _ -> Nothing ) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= singleton 5 " a"
10811081
1082+ updateMin (\ a -> Just (" X" ++ a)) (empty :: SMap ) @?= empty
1083+ updateMin (\ _ -> Nothing ) (empty :: SMap ) @?= empty
1084+
10821085test_updateMax :: Assertion
10831086test_updateMax = do
10841087 updateMax (\ a -> Just (" X" ++ a)) (fromList [(5 ," a" ), (3 ," b" )]) @?= fromList [(3 , " b" ), (5 , " Xa" )]
@@ -1087,6 +1090,9 @@ test_updateMax = do
10871090 updateMax (\ a -> Just (" X" ++ a)) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= fromList [(- 3 , " b" ), (5 , " Xa" )]
10881091 updateMax (\ _ -> Nothing ) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= singleton (- 3 ) " b"
10891092
1093+ updateMax (\ a -> Just (" X" ++ a)) (empty :: SMap ) @?= empty
1094+ updateMax (\ _ -> Nothing ) (empty :: SMap ) @?= empty
1095+
10901096test_updateMinWithKey :: Assertion
10911097test_updateMinWithKey = do
10921098 updateMinWithKey (\ k a -> Just ((show k) ++ " :" ++ a)) (fromList [(5 ," a" ), (3 ," b" )]) @?= fromList [(3 ," 3:b" ), (5 ," a" )]
@@ -1095,6 +1101,9 @@ test_updateMinWithKey = do
10951101 updateMinWithKey (\ k a -> Just ((show k) ++ " :" ++ a)) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= fromList [(- 3 ," -3:b" ), (5 ," a" )]
10961102 updateMinWithKey (\ _ _ -> Nothing ) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= singleton 5 " a"
10971103
1104+ updateMinWithKey (\ k a -> Just ((show k) ++ " :" ++ a)) (empty :: SMap ) @?= empty
1105+ updateMinWithKey (\ _ _ -> Nothing ) (empty :: SMap ) @?= empty
1106+
10981107test_updateMaxWithKey :: Assertion
10991108test_updateMaxWithKey = do
11001109 updateMaxWithKey (\ k a -> Just ((show k) ++ " :" ++ a)) (fromList [(5 ," a" ), (3 ," b" )]) @?= fromList [(3 ," b" ), (5 ," 5:a" )]
@@ -1103,6 +1112,9 @@ test_updateMaxWithKey = do
11031112 updateMaxWithKey (\ k a -> Just ((show k) ++ " :" ++ a)) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= fromList [(- 3 ," b" ), (5 ," 5:a" )]
11041113 updateMaxWithKey (\ _ _ -> Nothing ) (fromList [(5 ," a" ), (- 3 ," b" )]) @?= singleton (- 3 ) " b"
11051114
1115+ updateMaxWithKey (\ k a -> Just ((show k) ++ " :" ++ a)) (empty :: SMap ) @?= empty
1116+ updateMaxWithKey (\ _ _ -> Nothing ) (empty :: SMap ) @?= empty
1117+
11061118test_minView :: Assertion
11071119test_minView = do
11081120 minView (fromList [(5 ," a" ), (3 ," b" )]) @?= Just (" b" , singleton 5 " a" )
0 commit comments