on master help sign in
Add a negative timezone test with a non-zero number of minutes

This is cherry-picked from gh-270.

commit62ba91282e34182179b946219a6238ac62e11d11 authorBryan O'Sullivan <bos@serpentine.com> dateMon 20 Jul 2015, 23:58 (11 years ago) parentefb569d
1 file changed+3
tests/UnitTests.hs+3
tests/UnitTests.hs+3
@@ -107,15 +107,18 @@ utcTimeGood = do
107107 let ts6 = "2015-01-01T12:30:00.00+01:15" :: LT.Text
108108 let ts7 = "2015-01-01T12:30:00.00-0200" :: LT.Text
109109 let ts8 = "2015-01-01T22:00:00.00-03:00" :: LT.Text
110+ let ts9 = "2015-01-01T22:00:00.00-04:30" :: LT.Text
110111 let (Just (t5 :: UTCTime)) = parseWithAeson ts5
111112 let (Just (t6 :: UTCTime)) = parseWithAeson ts6
112113 let (Just (t7 :: UTCTime)) = parseWithAeson ts7
113114 let (Just (t8 :: UTCTime)) = parseWithAeson ts8
115+ let (Just (t9 :: UTCTime)) = parseWithAeson ts9
114116 assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-01-01T12:30:00.00Z") t5
115117 assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-01-01T11:15:00.00Z") t6
116118 assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-01-01T14:30:00Z") t7
117119 -- ts8 wraps around to the next day in UTC
118120 assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-01-02T01:00:00Z") t8
121+ assertEqual "utctime" (parseWithRead "%FT%T%QZ" "2015-01-02T02:30:00Z") t9
119122 where
120123 parseWithRead :: String -> LT.Text -> UTCTime
121124 parseWithRead f s =