mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-22 10:12:10 +01:00
tests: Add some missing GDateTime ISO8601 parsing tests
This improves test coverage, adding coverage for some lines which I spotted were not covered while testing the preceding commits. It doesn’t directly test the preceding commits, though. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
4c56ff8034
commit
7f6d81130e
@ -866,6 +866,23 @@ test_GDateTime_new_from_iso8601 (void)
|
||||
* NaN */
|
||||
dt = g_date_time_new_from_iso8601 ("0005306 000001,666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666600080000-00", NULL);
|
||||
g_assert_null (dt);
|
||||
|
||||
/* Various invalid timezone offsets which look like they could be in
|
||||
* `+hh:mm`, `-hh:mm`, `+hhmm`, `-hhmm`, `+hh` or `-hh` format */
|
||||
dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+01:xx", NULL);
|
||||
g_assert_null (dt);
|
||||
dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx:00", NULL);
|
||||
g_assert_null (dt);
|
||||
dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx:xx", NULL);
|
||||
g_assert_null (dt);
|
||||
dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+01xx", NULL);
|
||||
g_assert_null (dt);
|
||||
dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx00", NULL);
|
||||
g_assert_null (dt);
|
||||
dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xxxx", NULL);
|
||||
g_assert_null (dt);
|
||||
dt = g_date_time_new_from_iso8601 ("2025-02-18T18:14:00+xx", NULL);
|
||||
g_assert_null (dt);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user