From: panne Date: Mon, 2 Apr 2001 21:11:14 +0000 (+0000) Subject: [project @ 2001-04-02 21:11:14 by panne] X-Git-Tag: Approximately_9120_patches~2227 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0b9486bb244fd5c211c117bb26f497268464a5e7;p=ghc-hetmet.git [project @ 2001-04-02 21:11:14 by panne] Take 4-letter timezones like "CEST" into account. Nevertheless, these test are bogus IMHO... --- 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