RegressionTests__TimeAndDateTest.st
changeset 1224 85b0ce90c09b
parent 1222 b476e1efa7f1
child 1225 67d011bbcad5
--- a/RegressionTests__TimeAndDateTest.st	Thu Nov 06 17:03:19 2014 +0100
+++ b/RegressionTests__TimeAndDateTest.st	Thu Nov 06 17:11:30 2014 +0100
@@ -436,7 +436,7 @@
 !
 
 test_12_dateQueries
-    |d1 d2|
+    |d1 d2 d3|
 
     d1 := Date newDay:1 month:1 year:1940.
     d2 := Date newDay:1 month:1 year:1941.   
@@ -448,6 +448,27 @@
 
     self assert:(d1 addDays:366) = d2.
 
+    d1 := Date newDay:1 year:1901.
+    self assert:(d1 day = 1).
+    self assert:(d1 month = 1).
+    self assert:(d1 year = 1901).
+
+    "/ 1900 was NOT a leap year
+    self assert:(Date leapYear:1900) not.
+    "/ 2000 was a leap year
+    self assert:(Date leapYear:2000).
+
+    d2 := d1 subtractDays:365.
+    self assert:(d2 day = 1).
+    self assert:(d2 month = 1).
+    self assert:(d2 year = 1900).
+
+    d3 := d2 subtractDays:365.
+    self assert:(d3 day = 1).
+    self assert:(d3 month = 1).
+    self assert:(d3 year = 1899).
+
+
     "
      self new test_12_dateQueries
     "