RegressionTests__TimeAndDateTest.st
changeset 1229 881b11022fea
parent 1227 d303d4c8b01d
child 1230 a26cae3351a6
--- a/RegressionTests__TimeAndDateTest.st	Fri Nov 07 22:22:34 2014 +0100
+++ b/RegressionTests__TimeAndDateTest.st	Sat Nov 08 00:30:45 2014 +0100
@@ -555,6 +555,10 @@
     self assert:(d3 month = 1).
     self assert:(d3 year = 1899).
 
+    d1 := Date newDay:1 month:2 year:2540.  
+    d2 := Date newDay:1 month:2 year:2541.   
+    self assert:(d2 - d1) = 366.
+
 
     "
      self new test_12_dateQueries
@@ -601,6 +605,18 @@
     self assert:d2 asDate isLeapYear not.
     self assert:(d2 - d1) days = 366.
 
+    d1 := Timestamp newDay:1 month:1 year:2038.
+ self halt.   d2 := Timestamp newDay:1 month:1 year:2039.   
+    self assert:d1 asDate isLeapYear.
+    self assert:d2 asDate isLeapYear not.
+    self assert:(d2 - d1) days = 366.
+
+    d1 := Timestamp newDay:1 month:1 year:2540.
+    d2 := Timestamp newDay:1 month:1 year:2541.   
+    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.