summaryrefslogtreecommitdiff
path: root/test/time.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-08-17 09:11:02 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2016-08-17 09:11:02 +0100
commit2d5db505e70336e56e739d56d8ca358fc6bc4a6a (patch)
tree7e4d9d58ecd1e714959922b98e575ab68976ef0d /test/time.c
parent30646c31454cb3effc7bba66ae74f0a4a708ebe0 (diff)
downloadnetsurf-2d5db505e70336e56e739d56d8ca358fc6bc4a6a.tar.gz
netsurf-2d5db505e70336e56e739d56d8ca358fc6bc4a6a.tar.bz2
Test: Add trailing whitespace and garbage datetime string parse tests.
Diffstat (limited to 'test/time.c')
-rw-r--r--test/time.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/time.c b/test/time.c
index 34cfac0f0..07e59e968 100644
--- a/test/time.c
+++ b/test/time.c
@@ -213,6 +213,10 @@ static const struct test_string_pair date_string_tests[] = {
.expected = "Mon, 12 Dec 2005 00:00:00 GMT"
},
{
+ .test = "20051212 \n",
+ .expected = "Mon, 12 Dec 2005 00:00:00 GMT"
+ },
+ {
.test = "20051212 00:00 UTC",
.expected = "Mon, 12 Dec 2005 00:00:00 GMT"
},
@@ -233,6 +237,10 @@ static const struct test_string_pair date_string_tests[] = {
.expected = "Thu, 11 Aug 2016 08:47:30 GMT"
},
{
+ .test = "Thu, 11 Aug 2016 08:47:30 GMT garbage",
+ .expected = "Thu, 11 Aug 2016 08:47:30 GMT"
+ },
+ {
.test = "Thu, 11 Aug 2016 08:47:30 UTC",
.expected = "Thu, 11 Aug 2016 08:47:30 GMT"
},
@@ -340,6 +348,10 @@ static const struct test_bad_string date_bad_string_tests[] = {
.test = "Foosday, 16 Dec 1977 23:45:12 GMT",
.res = NSERROR_INVALID
},
+ {
+ .test = "20051212 garbage",
+ .res = NSERROR_INVALID
+ },
};
/**