summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-30 00:41:23 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-30 00:41:23 -0400
commitef934efb3a264a619a86f7cc9df801d43c41e6a7 (patch)
tree5914a5caf468b5c6efafa4beb4221f5f05af8298 /test/unit
parent54e24a4aa24df99693919cb3b3aa9abe775bebec (diff)
downloadfork-ledger-ef934efb3a264a619a86f7cc9df801d43c41e6a7.tar.gz
fork-ledger-ef934efb3a264a619a86f7cc9df801d43c41e6a7.tar.bz2
fork-ledger-ef934efb3a264a619a86f7cc9df801d43c41e6a7.zip
Added a slew of date/time format tests (inactive, however).
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/t_times.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/unit/t_times.cc b/test/unit/t_times.cc
index a249ad3b..f93a1b36 100644
--- a/test/unit/t_times.cc
+++ b/test/unit/t_times.cc
@@ -104,6 +104,51 @@ void DateTimeTestCase::testConstructors()
assertThrow(parse_datetime("fecruary"), datetime_error);
assertThrow(parse_datetime("207x"), datetime_error);
assertThrow(parse_datetime("hello"), datetime_error);
+
+ d1 = parse_datetime("2002-02-02");
+ d1 = parse_datetime("2002/02/02");
+ d1 = parse_datetime("2002.02.02");
+ d1 = parse_datetime("02-02-2002");
+ d1 = parse_datetime("02/02/2002");
+ d1 = parse_datetime("02.02.2002");
+ d1 = parse_datetime("02-02-02");
+ d1 = parse_datetime("02/02/02");
+ d1 = parse_datetime("02.02.02");
+ d1 = parse_datetime("02-02");
+ d1 = parse_datetime("02/02");
+ d1 = parse_datetime("02.02");
+ d1 = parse_datetime("20020202");
+ d1 = parse_datetime("20020202T023318");
+ d1 = parse_datetime("20020202T023318-0700");
+ d1 = parse_datetime("20020202T023318-0100");
+ d1 = parse_datetime("02-Feb-2002");
+ d1 = parse_datetime("2002-Feb-02");
+ d1 = parse_datetime("02 Feb 2002");
+ d1 = parse_datetime("02-Feb-2002");
+ d1 = parse_datetime("02 February 2002");
+ d1 = parse_datetime("02-February-2002");
+ d1 = parse_datetime("2002 Feb 02");
+ d1 = parse_datetime("2002-Feb-02");
+ d1 = parse_datetime("2002 February 02");
+ d1 = parse_datetime("2002-February-02");
+ d1 = parse_datetime("02 Feb");
+ d1 = parse_datetime("02-Feb");
+ d1 = parse_datetime("02 February");
+ d1 = parse_datetime("02-February");
+ d1 = parse_datetime("Feb 02");
+ d1 = parse_datetime("Feb-02");
+ d1 = parse_datetime("February 02");
+ d1 = parse_datetime("February-02");
+ d1 = parse_datetime("Feb 02, 2002");
+ d1 = parse_datetime("February 02, 2002");
+ d1 = parse_datetime("2002-02-02 12:00:00");
+ d1 = parse_datetime("2002-02-02 12:00:00 AM");
+ d1 = parse_datetime("2002-02-02 12:00 AM");
+ d1 = parse_datetime("2002-02-02 12:00AM");
+ d1 = parse_datetime("2002-02-02 12p");
+ d1 = parse_datetime("2002-02-02 12a");
+
+ assertValid(d1);
#endif // NOT_FOR_PYTHON
#endif
}