@@ -74,14 +74,14 @@ tests = testGroup "unit" [
7474 assertEqual "" "camel_api_case" (camelTo2 '_' "CamelAPICase")
7575 ]
7676 , testGroup "encoding" [
77− testCase "goodProducer" $ goodProducer
77+ testCase "goodProducer" goodProducer
7878 ]
7979 , testGroup "utctime" [
80− testCase "good" $ utcTimeGood
81− , testCase "bad" $ utcTimeBad
80+ testCase "good" utcTimeGood
81+ , testCase "bad" utcTimeBad
8282 ]
8383 , testGroup "formatError" [
84− testCase "example 1" $ formatErrorExample
84+ testCase "example 1" formatErrorExample
8585 ]
8686 , testGroup ".:, .:?, .:!" $ fmap (testCase "-") dotColonMark
8787 , testGroup "JSONPath" $ fmap (testCase "-") jsonPath
@@ -187,11 +187,9 @@ utcTimeGood = do
187187 where
188188 parseWithRead :: String -> LT.Text -> UTCTime
189189 parseWithRead f s =
190− case parseTime defaultTimeLocale f . LT.unpack $ s of
191− Nothing -> error "parseTime input malformed"
192− Just t -> t
190+ fromMaybe (error "parseTime input malformed") . parseTime defaultTimeLocale f . LT.unpack $ s
193191 parseWithAeson :: LT.Text -> Maybe UTCTime
194− parseWithAeson s = decode . LT.encodeUtf8 $ (LT.concat ["\"", s, "\""])
192+ parseWithAeson s = decode . LT.encodeUtf8 $ LT.concat ["\"", s, "\""]
195193
196194-- Test that a few non-timezone qualified timestamp formats get
197195-- rejected if decoding to UTCTime.
@@ -207,7 +205,7 @@ utcTimeBad = do
207205 verifyFailParse "2015-01-03 12:13.000Z" -- decimal at the end, but no seconds
208206 where
209207 verifyFailParse (s :: LT.Text) =
210− let (dec :: Maybe UTCTime) = decode . LT.encodeUtf8 $ (LT.concat ["\"", s, "\""]) in
208+ let (dec :: Maybe UTCTime) = decode . LT.encodeUtf8 $ LT.concat ["\"", s, "\""] in
211209 assertEqual "verify failure" Nothing dec
212210
213211-- Non identifier keys should be escaped & enclosed in brackets
@@ -235,11 +233,11 @@ dotColonMark = [
235233 , assertEqual ".: 42" (Just (T1 (Just 42))) (decode ex2 :: Maybe T1)
236234 , assertEqual ".: null" (Just (T1 Nothing)) (decode ex3 :: Maybe T1)
237235
238− , assertEqual ".:? not-present" (Just (T2 (Nothing))) (decode ex1 :: Maybe T2)
236+ , assertEqual ".:? not-present" (Just (T2 Nothing)) (decode ex1 :: Maybe T2)
239237 , assertEqual ".:? 42" (Just (T2 (Just 42))) (decode ex2 :: Maybe T2)
240238 , assertEqual ".:? null" (Just (T2 Nothing)) (decode ex3 :: Maybe T2)
241239
242− , assertEqual ".:! not-present" (Just (T3 (Nothing))) (decode ex1 :: Maybe T3)
240+ , assertEqual ".:! not-present" (Just (T3 Nothing)) (decode ex1 :: Maybe T3)
243241 , assertEqual ".:! 42" (Just (T3 (Just 42))) (decode ex2 :: Maybe T3)
244242 , assertEqual ".:! null" Nothing (decode ex3 :: Maybe T3)
245243 ]