From 0b9486bb244fd5c211c117bb26f497268464a5e7 Mon Sep 17 00:00:00 2001 From: panne Date: Mon, 2 Apr 2001 21:11:14 +0000 Subject: [PATCH] [project @ 2001-04-02 21:11:14 by panne] Take 4-letter timezones like "CEST" into account. Nevertheless, these test are bogus IMHO... --- ghc/tests/io/should_run/io019.hs | 14 +++++++------- ghc/tests/io/should_run/io019.stdout | 4 ++-- ghc/tests/io/should_run/io020.hs | 11 ++++------- ghc/tests/io/should_run/io020.stdout | 5 +---- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/ghc/tests/io/should_run/io019.hs b/ghc/tests/io/should_run/io019.hs index 039024f..ac2c72d 100644 --- a/ghc/tests/io/should_run/io019.hs +++ b/ghc/tests/io/should_run/io019.hs @@ -1,18 +1,18 @@ - import Time -main = - getClockTime >>= \ time -> - print (length (show time)) >> - +main :: IO () +main = do + time <- getClockTime + let l = length (show time) + print (l == 28 || l == 29) -- "CEST" vs "UTC" vs "GMT" vs... let (CalendarTime year month mday hour min sec psec wday yday timezone gmtoff isdst) = toUTCTime time time2 = wdays !! fromEnum wday ++ (' ' : months !! fromEnum month) ++ (' ' : shows2 mday (' ' : shows2 hour (':' : shows2 min (':' : shows2 sec (' ' : timezone ++ ' ' : shows year "\n"))))) - in - print (length time2) + l2 = length time2 + print (l == 28 || l == 29) where wdays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] diff --git a/ghc/tests/io/should_run/io019.stdout b/ghc/tests/io/should_run/io019.stdout index f12a894..dbde422 100644 --- a/ghc/tests/io/should_run/io019.stdout +++ b/ghc/tests/io/should_run/io019.stdout @@ -1,2 +1,2 @@ -28 -29 +True +True diff --git a/ghc/tests/io/should_run/io020.hs b/ghc/tests/io/should_run/io020.hs index 83c5786..31fd567 100644 --- a/ghc/tests/io/should_run/io020.hs +++ b/ghc/tests/io/should_run/io020.hs @@ -1,13 +1,10 @@ import Time -main = - getClockTime >>= \ time -> +main :: IO () +main = do + time <- getClockTime let (CalendarTime year month mday hour min sec psec wday yday timezone gmtoff isdst) = toUTCTime time time' = toClockTime (CalendarTime (year - 1) month mday hour min sec psec wday yday timezone gmtoff isdst) - in - print (length (show time)) >> - putChar '\n' >> - print (length (show time')) >> - putChar '\n' + print (length (show time) == length (show time')) diff --git a/ghc/tests/io/should_run/io020.stdout b/ghc/tests/io/should_run/io020.stdout index 828d4ac..0ca9514 100644 --- a/ghc/tests/io/should_run/io020.stdout +++ b/ghc/tests/io/should_run/io020.stdout @@ -1,4 +1 @@ -28 - -28 - +True -- 1.7.10.4