summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-07-28 14:56:26 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-08-08 14:14:34 +0300
commit990b3b11b9427ffd86f693d3f4c3dd351891e5d0 (patch)
tree73c434da712d210459ae771bb83ac18cd56d7e3f /test
parent83bd4c213583058340d0606f2d24c85489091ccf (diff)
downloadqtlocation-mapboxgl-990b3b11b9427ffd86f693d3f4c3dd351891e5d0.tar.gz
[core] Replace Boost.Spirit with std::regex in CacheControl::parse()
Diffstat (limited to 'test')
-rw-r--r--test/storage/headers.test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/storage/headers.test.cpp b/test/storage/headers.test.cpp
index b7dcfc025d..613f469b59 100644
--- a/test/storage/headers.test.cpp
+++ b/test/storage/headers.test.cpp
@@ -10,6 +10,10 @@ TEST(HTTPHeader, Parsing) {
ASSERT_FALSE(bool(cc.maxAge));
EXPECT_FALSE(cc.mustRevalidate);
+ cc = http::CacheControl::parse(R"#("max-age=34)#");
+ ASSERT_FALSE(bool(cc.maxAge));
+ EXPECT_FALSE(cc.mustRevalidate);
+
cc = http::CacheControl::parse(R"#(max-age =34)#");
ASSERT_TRUE(bool(cc.maxAge));
EXPECT_EQ(34u, *cc.maxAge);
@@ -38,6 +42,11 @@ TEST(HTTPHeader, Parsing) {
EXPECT_EQ(3u, *cc.maxAge);
EXPECT_FALSE(cc.mustRevalidate);
+ cc = http::CacheControl::parse(R"#(max-age=3,max-age=""34)#");
+ ASSERT_TRUE(bool(cc.maxAge));
+ EXPECT_EQ(3u, *cc.maxAge);
+ EXPECT_FALSE(cc.mustRevalidate);
+
cc = http::CacheControl::parse(R"#(max-age="\",max-age=4,")#");
ASSERT_FALSE(bool(cc.maxAge));
EXPECT_FALSE(cc.mustRevalidate);