[glib/wip/rancell/iso8601-2] more tests
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/rancell/iso8601-2] more tests
- Date: Sat, 24 Jun 2017 08:22:29 +0000 (UTC)
commit e48f208e3bdd65f702451795ecd46806ef7ea126
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Jun 24 20:22:18 2017 +1200
more tests
glib/tests/gdatetime.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index cbbf64b..efed217 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -604,10 +604,17 @@ test_GDateTime_new_from_iso8601 (void)
dt = g_date_time_new_from_iso8601 ("2016-W00-1T22:10:42");
g_assert (dt == NULL);
- /* Largest week is 53 (but only for some years) */
+ /* Week one might be in the previous year */
+ dt = g_date_time_new_from_iso8601 ("2015-W01-1T22:10:42");
+ ASSERT_DATE (dt, 2014, 12, 29);
+ g_date_time_unref (dt);
+
+ /* Last week might be in next year */
dt = g_date_time_new_from_iso8601 ("2015-W53-7T22:10:42");
ASSERT_DATE (dt, 2016, 1, 3);
g_date_time_unref (dt);
+
+ /* Week 53 doesn't always exist */
dt = g_date_time_new_from_iso8601 ("2016-W53-1T22:10:42");
g_assert (dt == NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]