Testing for all Replace rules in use
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 1 Jul 2013 13:46:43 +0000 (15:46 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 1 Jul 2013 13:46:43 +0000 (15:46 +0200)
src/test_filter_rewrite.cpp

index 7df4d0b..c38c022 100644 (file)
@@ -84,6 +84,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             " <response verbose=\"1\">\n"
             "   <rule name=\"null\"/>\n"
             "   <rule name=\"url\">\n"
+            "     <rewrite from='foo' to='bar'/>\n"
             "     <rewrite from='"
     "(?&lt;proto>https?://)(?&lt;host>[^/?# &quot;&apos;>]+)/(?&lt;path>[^  &quot;&apos;>]+)'\n"
             "            to='${proto}${pxhost}/${pxpath}/${host}/${path}' />\n"
@@ -133,7 +134,9 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             "}"
             "</style>"
             "</head>"
-            "<script>var jslink=\"http://targetsite/webservice.xml\";</script>"
+            "<script>var jslink=\"http://targetsite/webservice.xml\";"
+            "var some=foo;"
+            "</script>"
             "<body>"
             "<p>Welcome to our website. It doesn't make it easy to get pro"
             "xified"
@@ -146,7 +149,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
 
         const char *resp_expected =
             "HTTP/1.1 200 OK\r\n"
-            "Content-Length: 520\r\n"
+            "Content-Length: 533\r\n"
             "Content-Type: text/html\r\n"
             "Link: <http://proxyhost/proxypath/targetsite/file.xml>; rel=absolute\r\n"
             "Link: </dir/file.xml>; rel=relative\r\n"
@@ -158,7 +161,9 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 )
             "}"
             "</style>"
             "</head>"
-            "<script>var jslink=\"http://proxyhost/proxypath/targetsite/webservice.xml\";</script>"
+            "<script>var jslink=\"http://proxyhost/proxypath/targetsite/webservice.xml\";"
+            "var some=bar;"
+            "</script>"
             "<body>"
             "<p>Welcome to our website. It doesn't make it easy to get pro"
             "xified"