Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
himura committed Nov 12, 2021
1 parent d07a932 commit 4f74a95
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions twitter-types/tests/Instances.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
Expand All @@ -7,7 +8,11 @@ module Instances where

import Control.Applicative
import Data.Aeson
import Data.HashMap.Strict as HashMap
#if MIN_VERSION_aeson(2, 0, 0)
import Data.Aeson.KeyMap as KeyMap
#else
import Data.HashMap.Strict as KeyMap
#endif
import Data.String
import qualified Data.Text as T
import Data.Time (UTCTime (..), readTime, fromGregorian, defaultTimeLocale)
Expand All @@ -30,8 +35,8 @@ instance Arbitrary T.Text where
arbitrary = T.pack <$> arbitrary

instance Arbitrary Value where
arbitrary = elements [ Object HashMap.empty
, Object (HashMap.fromList [("test", Number 2), ("value", String "non empty")])
arbitrary = elements [ Object KeyMap.empty
, Object (KeyMap.fromList [("test", Number 2), ("value", String "non empty")])
]

-- derive makeArbitrary ''StreamingAPI
Expand Down Expand Up @@ -108,7 +113,7 @@ instance Arbitrary MediaEntity where
MediaEntity
<$> arbitrary
<*> arbitrary
<*> pure (HashMap.fromList [("medium", ms)])
<*> pure (KeyMap.fromList [("medium", ms)])
<*> arbitrary
<*> arbitrary
<*> arbitrary
Expand All @@ -120,7 +125,7 @@ instance Arbitrary Coordinates where

instance Arbitrary Place where
arbitrary = do
Place HashMap.empty
Place KeyMap.empty
<$> arbitrary
<*> arbitrary
<*> arbitrary
Expand All @@ -143,7 +148,7 @@ instance Arbitrary ExtendedEntity where
<$> arbitrary
<*> arbitrary
<*> arbitrary
<*> pure (HashMap.fromList [("medium", ms)])
<*> pure (KeyMap.fromList [("medium", ms)])
<*> arbitrary
<*> arbitrary
<*> arbitrary
Expand Down

0 comments on commit 4f74a95

Please sign in to comment.