From 2170b850ee52fb79480f1d17fb780bb8bd317365 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 17 Jan 2009 14:24:57 +0000 Subject: [PATCH] Bring date_test up to date with new Span format; passes 100% svn: r11643 --- src/gen/lib/test/date_test.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gen/lib/test/date_test.py b/src/gen/lib/test/date_test.py index 4c94db603..da65de5f5 100644 --- a/src/gen/lib/test/date_test.py +++ b/src/gen/lib/test/date_test.py @@ -303,6 +303,7 @@ def suite(): ("about 1995", "after 2005", False), ("about 2007", "about 2003", True), ("before 2007", "2000", True), + # offsets # different calendar, same date ("Aug 3, 1982", "14 Thermidor 190 (French Republican)", True), ("after Aug 3, 1982", @@ -353,12 +354,12 @@ def suite2(): ("Date(2000) - 1", "Date(1999)"), ("Date(2000) + 1", "Date(2001)"), # Date +/- Date -> Span - ("Date(1876,5,7) - Date(1876,5,1)", "Span(0, 0, 6)"), - ("Date(1876,5,7) - Date(1876,4,30)", "Span(0, 0, 7)"), - ("Date(2000,1,1) - Date(1999,2,1)", "Span(0, 11, 0)"), - ("Date(2000,1,1) - Date(1999,12,1)", "Span(0, 1, 0)"), - ("Date(2007, 12, 23) - Date(1963, 12, 4)", "Span(44, 0, 19)"), - ("Date(1963, 12, 4) - Date(2007, 12, 23)", "Span(-44, 0, -19)"), + ("(Date(1876,5,7) - Date(1876,5,1)).tuple()", "(0, 0, 6)"), + ("(Date(1876,5,7) - Date(1876,4,30)).tuple()", "(0, 0, 7)"), + ("(Date(2000,1,1) - Date(1999,2,1)).tuple()", "(0, 11, 0)"), + ("(Date(2000,1,1) - Date(1999,12,1)).tuple()", "(0, 1, 0)"), + ("(Date(2007, 12, 23) - Date(1963, 12, 4)).tuple()", "(44, 0, 19)"), + ("(Date(1963, 12, 4) - Date(2007, 12, 23)).tuple()", "(-44, 0, -19)"), ] suite = unittest.TestSuite() count = 1