summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-08-17 08:11:02 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2016-08-17 08:11:02 (GMT)
commit2d5db505e70336e56e739d56d8ca358fc6bc4a6a (patch)
tree7e4d9d58ecd1e714959922b98e575ab68976ef0d
parent30646c31454cb3effc7bba66ae74f0a4a708ebe0 (diff)
downloadnetsurf-2d5db505e70336e56e739d56d8ca358fc6bc4a6a.tar.gz
netsurf-2d5db505e70336e56e739d56d8ca358fc6bc4a6a.tar.bz2
Test: Add trailing whitespace and garbage datetime string parse tests.
-rw-r--r--test/time.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/time.c b/test/time.c
index 34cfac0..07e59e9 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
+ },
};
/**