[project @ 2001-04-02 21:11:14 by panne]
authorpanne <unknown>
Mon, 2 Apr 2001 21:11:14 +0000 (21:11 +0000)
committerpanne <unknown>
Mon, 2 Apr 2001 21:11:14 +0000 (21:11 +0000)
Take 4-letter timezones like "CEST" into account. Nevertheless, these
test are bogus IMHO...

ghc/tests/io/should_run/io019.hs
ghc/tests/io/should_run/io019.stdout
ghc/tests/io/should_run/io020.hs
ghc/tests/io/should_run/io020.stdout

index 039024f..ac2c72d 100644 (file)
@@ -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"]
index 83c5786..31fd567 100644 (file)
@@ -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'))