X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/9febc2b238e1e322dce1f94ecbed46d595893b52..173fa882cf3396ab6d2a9be53c6ea23eda225a1d:/test/libapt/strutil_test.cc diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc index b7ba816ee..90a5817ad 100644 --- a/test/libapt/strutil_test.cc +++ b/test/libapt/strutil_test.cc @@ -253,6 +253,18 @@ TEST(StrUtilTest,RFC1123StrToTime) time_t t; EXPECT_TRUE(RFC1123StrToTime("Sun, 06 Nov 1994 08:49:37 GMT", t)); EXPECT_EQ(784111777, t); + } { + time_t t; + EXPECT_TRUE(RFC1123StrToTime("Sun, 6 Nov 1994 08:49:37 UTC", t)); + EXPECT_EQ(784111777, t); + } { + time_t t; + EXPECT_TRUE(RFC1123StrToTime("Sun, 6 Nov 1994 08:49:37 UTC", t)); + EXPECT_EQ(784111777, t); + } { + time_t t; + EXPECT_TRUE(RFC1123StrToTime("Sun, 06 Nov 1994 8:49:37 UTC", t)); + EXPECT_EQ(784111777, t); } { time_t t; EXPECT_TRUE(RFC1123StrToTime("Sun, 06 Nov 1994 08:49:37 UTC", t)); @@ -269,16 +281,39 @@ TEST(StrUtilTest,RFC1123StrToTime) time_t t; EXPECT_TRUE(RFC1123StrToTime("Sunday, 06-Nov-94 08:49:37 GMT", t)); EXPECT_EQ(784111777, t); + } { + time_t t; + EXPECT_TRUE(RFC1123StrToTime("Sunday, 6-Nov-94 08:49:37 GMT", t)); + EXPECT_EQ(784111777, t); + } { + time_t t; + EXPECT_TRUE(RFC1123StrToTime("Sunday, 06-Nov-94 8:49:37 GMT", t)); + EXPECT_EQ(784111777, t); } { time_t t; EXPECT_TRUE(RFC1123StrToTime("Sun Nov 6 08:49:37 1994", t)); EXPECT_EQ(784111777, t); + } { + time_t t; + EXPECT_TRUE(RFC1123StrToTime("Sun Nov 06 08:49:37 1994", t)); + EXPECT_EQ(784111777, t); + } { + time_t t; + EXPECT_TRUE(RFC1123StrToTime("Sun Nov 6 8:49:37 1994", t)); + EXPECT_EQ(784111777, t); } time_t t; + EXPECT_FALSE(RFC1123StrToTime("So, 06 Nov 1994 08:49:37 UTC", t)); + EXPECT_FALSE(RFC1123StrToTime(", 06 Nov 1994 08:49:37 UTC", t)); + EXPECT_FALSE(RFC1123StrToTime("Son, 06 Nov 1994 08:49:37 UTC", t)); + EXPECT_FALSE(RFC1123StrToTime("Sun: 06 Nov 1994 08:49:37 UTC", t)); EXPECT_FALSE(RFC1123StrToTime("Sun, 06 Nov 1994 08:49:37", t)); + EXPECT_FALSE(RFC1123StrToTime("Sun, 06 Nov 1994 08:49:37 GMT+1", t)); EXPECT_FALSE(RFC1123StrToTime("Sun, 06 Nov 1994 GMT", t)); + EXPECT_FALSE(RFC1123StrToTime("Sunday, 06 Nov 1994 GMT", t)); EXPECT_FALSE(RFC1123StrToTime("Sonntag, 06 Nov 1994 08:49:37 GMT", t)); EXPECT_FALSE(RFC1123StrToTime("domingo Nov 6 08:49:37 1994", t)); + EXPECT_FALSE(RFC1123StrToTime("Sunday: 06-Nov-94 08:49:37 GMT", t)); EXPECT_FALSE(RFC1123StrToTime("Sunday, 06-Nov-94 08:49:37 GMT+1", t)); EXPECT_FALSE(RFC1123StrToTime("Sunday, 06-Nov-94 08:49:37 EDT", t)); EXPECT_FALSE(RFC1123StrToTime("Sunday, 06-Nov-94 08:49:37 -0100", t));