1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Test against integer keys/values.

This commit is contained in:
Rob Rix 2016-07-12 18:11:09 -04:00
parent 449c564179
commit ae9b0e55f3

View File

@ -47,16 +47,16 @@ spec = parallel $ do
describe "align" $ do
prop "has nil as a right-identity modulo This" $
\ a -> align a nil `shouldBe` (This <$> a :: Map.OrderedMap Text (These Text Text))
\ a -> align a nil `shouldBe` (This <$> a :: Map.OrderedMap Int (These Int Int))
prop "has nil as a left-identity modulo That" $
\ a -> align nil a `shouldBe` (That <$> a :: Map.OrderedMap Text (These Text Text))
\ a -> align nil a `shouldBe` (That <$> a :: Map.OrderedMap Int (These Int Int))
prop "is at least as long as its longest input" $
\ a b -> length (align a b :: Map.OrderedMap Text (These Int Int)) `shouldSatisfy` (>= max (length a) (length b))
\ a b -> length (align a b :: Map.OrderedMap Int (These Int Int)) `shouldSatisfy` (>= max (length a) (length b))
prop "is no longer than the sum of its inputs lengths" $
\ a b -> length (align a b :: Map.OrderedMap Text (These Int Int)) `shouldSatisfy` (<= length a + length b)
\ a b -> length (align a b :: Map.OrderedMap Int (These Int Int)) `shouldSatisfy` (<= length a + length b)
where a = Map.fromList [ ("a", 1), ("b", 2), ("c", 3) ]
b = Map.fromList [ ("b", -2), ("c", -3), ("d", -4) ]