@@ -177,47 +177,44 @@ data ParentMapping = ParentMapping deriving (Eq, Show)
177177
178178instance ToJSON ParentMapping where
179179 toJSON ParentMapping =
180− object ["parent" .=
181− object ["properties" .=
182− object [ "user" .= object ["type" .= ("string" :: Text)]
183− -- Serializing the date as a date is breaking other tests, mysteriously.
184− -- , "postDate" .= object [ "type" .= ("date" :: Text)
185− -- , "format" .= ("YYYY-MM-dd`T`HH:mm:ss.SSSZZ" :: Text)]
186− , "message" .= object ["type" .= ("string" :: Text)]
187− , "age" .= object ["type" .= ("integer" :: Text)]
188− , "location" .= object ["type" .= ("geo_point" :: Text)]
189− ]]]
180+ object ["properties" .=
181+ object [ "user" .= object ["type" .= ("string" :: Text)]
182+ -- Serializing the date as a date is breaking other tests, mysteriously.
183+ -- , "postDate" .= object [ "type" .= ("date" :: Text)
184+ -- , "format" .= ("YYYY-MM-dd`T`HH:mm:ss.SSSZZ" :: Text)]
185+ , "message" .= object ["type" .= ("string" :: Text)]
186+ , "age" .= object ["type" .= ("integer" :: Text)]
187+ , "location" .= object ["type" .= ("geo_point" :: Text)]
188+ ]]
190189
191190data ChildMapping = ChildMapping deriving (Eq, Show)
192191
193192instance ToJSON ChildMapping where
194193 toJSON ChildMapping =
195− object ["child" .=
196− object ["_parent" .= object ["type" .= ("parent" :: Text)]
197− , "properties" .=
198− object [ "user" .= object ["type" .= ("string" :: Text)]
199− -- Serializing the date as a date is breaking other tests, mysteriously.
200− -- , "postDate" .= object [ "type" .= ("date" :: Text)
201− -- , "format" .= ("YYYY-MM-dd`T`HH:mm:ss.SSSZZ" :: Text)]
202− , "message" .= object ["type" .= ("string" :: Text)]
203− , "age" .= object ["type" .= ("integer" :: Text)]
204− , "location" .= object ["type" .= ("geo_point" :: Text)]
205− ]]]
194+ object ["_parent" .= object ["type" .= ("parent" :: Text)]
195+ , "properties" .=
196+ object [ "user" .= object ["type" .= ("string" :: Text)]
197+ -- Serializing the date as a date is breaking other tests, mysteriously.
198+ -- , "postDate" .= object [ "type" .= ("date" :: Text)
199+ -- , "format" .= ("YYYY-MM-dd`T`HH:mm:ss.SSSZZ" :: Text)]
200+ , "message" .= object ["type" .= ("string" :: Text)]
201+ , "age" .= object ["type" .= ("integer" :: Text)]
202+ , "location" .= object ["type" .= ("geo_point" :: Text)]
203+ ]]
206204
207205data TweetMapping = TweetMapping deriving (Eq, Show)
208206
209207instance ToJSON TweetMapping where
210208 toJSON TweetMapping =
211− object ["tweet" .=
212− object ["properties" .=
213− object [ "user" .= object ["type" .= ("string" :: Text)]
214− -- Serializing the date as a date is breaking other tests, mysteriously.
215− -- , "postDate" .= object [ "type" .= ("date" :: Text)
216− -- , "format" .= ("YYYY-MM-dd`T`HH:mm:ss.SSSZZ" :: Text)]
217− , "message" .= object ["type" .= ("string" :: Text)]
218− , "age" .= object ["type" .= ("integer" :: Text)]
219− , "location" .= object ["type" .= ("geo_point" :: Text)]
220− ]]]
209+ object ["properties" .=
210+ object [ "user" .= object ["type" .= ("string" :: Text)]
211+ -- Serializing the date as a date is breaking other tests, mysteriously.
212+ -- , "postDate" .= object [ "type" .= ("date" :: Text)
213+ -- , "format" .= ("YYYY-MM-dd`T`HH:mm:ss.SSSZZ" :: Text)]
214+ , "message" .= object ["type" .= ("string" :: Text)]
215+ , "age" .= object ["type" .= ("integer" :: Text)]
216+ , "location" .= object ["type" .= ("geo_point" :: Text)]
217+ ]]
221218
222219exampleTweet :: Tweet
223220exampleTweet = Tweet { user = "bitemyapp"
@@ -623,8 +620,10 @@ instance Arbitrary Day where
623620 arbitrary = ModifiedJulianDay <$> (2000 +) <$> arbitrary
624621 shrink = (ModifiedJulianDay <$>) . shrink . toModifiedJulianDay
625622
623+#if !MIN_VERSION_QuickCheck(2,9,0)
626624instance Arbitrary a => Arbitrary (NonEmpty a) where
627625 arbitrary = liftA2 (:|) arbitrary arbitrary
626+#endif
628627
629628arbitraryScore :: Gen Score
630629arbitraryScore = fmap getPositive <$> arbitrary