on master help sign in
More map tests
commit1965e6471cb615e65497ed1b4ff9615635881ed7 authorOleg Grenrus <oleg.grenrus@iki.fi> dateThu 9 Jun 2016, 00:37 (10 years ago) parent36ebc06
1 file changed+8−1
tests/UnitTests.hs+8−1
tests/UnitTests.hs+8−1
@@ -47,6 +47,7 @@ import qualified Data.Text.Lazy.Encoding as LT
4747import qualified Data.Sequence as Seq
4848import qualified Data.DList as DList
4949import qualified Data.HashMap.Strict as HM
50+import qualified Data.Map as M
5051
5152tests :: Test
5253tests = testGroup "unit" [
@@ -277,8 +278,14 @@ jsonExamples =
277278 , Example "Seq" "[1,2,3]" (Seq.fromList [1, 2, 3] :: Seq.Seq Int)
278279 , Example "DList" "[1,2,3]" (DList.fromList [1, 2, 3] :: DList.DList Int)
279280 , Example "()" "[]" ()
280− , Example "HashMap Int Int" "{\"0\":1,\"2\":3}" (HM.fromList [(0,1),(2,3)] :: HM.HashMap Int Int)
281+
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+
281287 , Example "nan :: Double" "null" (Approx $ 0/0 :: Approx Double)
288+
282289 -- Three separate cases, as ordering in HashMap is not defined
283290 , Example "HashMap Float Int, NaN" "{\"NaN\":1}" (Approx $ HM.singleton (0/0) 1 :: Approx (HM.HashMap Float Int))
284291 , Example "HashMap Float Int, Infinity" "{\"Infinity\":1}" (HM.singleton (1/0) 1 :: HM.HashMap Float Int)