class: RegressionTests::TimeAndDateTest
authorClaus Gittinger <cg@exept.de>
Mon, 10 Nov 2014 16:18:55 +0100
changeset 1231 f07f482db8d0
parent 1230 a26cae3351a6
child 1232 01e685de57e3
class: RegressionTests::TimeAndDateTest class definition added:16 methods
RegressionTests__TimeAndDateTest.st
--- a/RegressionTests__TimeAndDateTest.st	Sat Nov 08 01:24:49 2014 +0100
+++ b/RegressionTests__TimeAndDateTest.st	Mon Nov 10 16:18:55 2014 +0100
@@ -566,7 +566,7 @@
 !
 
 test_13_timestampQueries
-    |d1 d2 l u|
+    |d1 d2 local utc|
 
     d1 := UtcTimestamp newDay:1 month:1 year:2000.
     d2 := UtcTimestamp newDay:1 month:1 year:2001.   
@@ -617,20 +617,26 @@
     self assert:d2 asDate isLeapYear not.
     self assert:(d2 - d1) days = 366.
 
+    d1 := Timestamp newDay:1 month:1 year:3540.
+    d2 := Timestamp newDay:1 month:1 year:3541.   
+    self assert:d1 asDate isLeapYear.
+    self assert:d2 asDate isLeapYear not.
+    self assert:(d2 - d1) days = 366.
+
     "/ local time vs. utc time
-    l := Timestamp newDay:1 month:1 year:1940.
-    u := UtcTimestamp newDay:1 month:1 year:1940.
-    self assert:(l asUtcTimestamp - u asUtcTimestamp) asSeconds = Timestamp now utcOffset.
+    local := Timestamp newDay:1 month:1 year:1940.
+    utc := UtcTimestamp newDay:1 month:1 year:1940.
+    self assert:(local asUtcTimestamp - utc asUtcTimestamp) asSeconds = Timestamp now utcOffset.
 
     "/ tz time vs. utc time
-    u := Timestamp readFrom:'20000102T123000Z'.
-    l := Timestamp readFrom:'20000102T123000+02'.  
-    self assert:(u - l) asSeconds = 7200.
+    utc := Timestamp readFrom:'20000102T123000Z'.
+    local := Timestamp readFrom:'20000102T123000+02'.  
+    self assert:(utc - local) asSeconds = 7200.
 
     "/ tz time vs. utc time
-    u := UtcTimestamp readFrom:'20000102T123000Z'.
-    l := UtcTimestamp readFrom:'20000102T123000-02'.  
-    self assert:(u - l) asSeconds = -7200.
+    utc := UtcTimestamp readFrom:'20000102T123000Z'.
+    local := UtcTimestamp readFrom:'20000102T123000-02'.  
+    self assert:(utc - local) asSeconds = -7200.
 
     "
      self new test_13_timestampQueries