on master help sign in
More map tests
1965e64Oleg Grenrus
tests/UnitTests.hs+8−1
@@ -47,6 +47,7 @@ import qualified Data.Text.Lazy.Encoding as LT
47import qualified Data.Sequence as Seq
47import qualified Data.Sequence as Seq
48import qualified Data.DList as DList
48import qualified Data.DList as DList
49import qualified Data.HashMap.Strict as HM
49import qualified Data.HashMap.Strict as HM
50+import qualified Data.Map as M
50
51
51tests :: Test
52tests :: Test
52tests = testGroup "unit" [
53tests = testGroup "unit" [
@@ -277,8 +278,14 @@ jsonExamples =
277 , Example "Seq" "[1,2,3]" (Seq.fromList [1, 2, 3] :: Seq.Seq Int)
278 , Example "Seq" "[1,2,3]" (Seq.fromList [1, 2, 3] :: Seq.Seq Int)
278 , Example "DList" "[1,2,3]" (DList.fromList [1, 2, 3] :: DList.DList Int)
279 , Example "DList" "[1,2,3]" (DList.fromList [1, 2, 3] :: DList.DList Int)
279 , Example "()" "[]" ()
280 , Example "()" "[]" ()
281+
280− , Example "HashMap Int Int" "{\"0\":1,\"2\":3}" (HM.fromList [(0,1),(2,3)] :: HM.HashMap Int Int)
282+ , Example "HashMap Int Int" "{\"0\":1,\"2\":3}" (HM.fromList [(0,1),(2,3)] :: HM.HashMap Int Int)
283+ , Example "Map Int Int" "{\"0\":1,\"2\":3}" (M.fromList [(0,1),(2,3)] :: M.Map Int Int)
284+ , Example "Map (Tagged Int Int) Int" "{\"0\":1,\"2\":3}" (M.fromList [(Tagged 0,1),(Tagged 2,3)] :: M.Map (Tagged Int Int) Int)
285+ , Example "Map [Int] Int" "[[[0],1],[[2],3]]" (M.fromList [([0],1),([2],3)] :: M.Map [Int] Int)
286+
281 , Example "nan :: Double" "null" (Approx $ 0/0 :: Approx Double)
287 , Example "nan :: Double" "null" (Approx $ 0/0 :: Approx Double)
288+
282 -- Three separate cases, as ordering in HashMap is not defined
289 -- Three separate cases, as ordering in HashMap is not defined
283 , Example "HashMap Float Int, NaN" "{\"NaN\":1}" (Approx $ HM.singleton (0/0) 1 :: Approx (HM.HashMap Float Int))
290 , Example "HashMap Float Int, NaN" "{\"NaN\":1}" (Approx $ HM.singleton (0/0) 1 :: Approx (HM.HashMap Float Int))
284 , Example "HashMap Float Int, Infinity" "{\"Infinity\":1}" (HM.singleton (1/0) 1 :: HM.HashMap Float Int)
291 , Example "HashMap Float Int, Infinity" "{\"Infinity\":1}" (HM.singleton (1/0) 1 :: HM.HashMap Float Int)