| 143 | } |
| 144 | |
| 145 | void SC::HttpURLParserTest::testInvalid() |
| 146 | { |
| 147 | HttpURLParser urlParser; |
| 148 | SC_TEST_EXPECT(not urlParser.parse("http:/site.com")); // missing double // |
| 149 | SC_TEST_EXPECT(not urlParser.parse("http.//site.com")); // wrong . instead of : |
| 150 | SC_TEST_EXPECT(not urlParser.parse("http//site.com")); // missing : |
| 151 | SC_TEST_EXPECT(not urlParser.parse("http://")); // missing host |
| 152 | SC_TEST_EXPECT(not urlParser.parse("http://a")); // no dot |
| 153 | SC_TEST_EXPECT(not urlParser.parse("http://site.com/asd dsa/")); // no space in paths |
| 154 | SC_TEST_EXPECT(not urlParser.parse("hppt://site.com")); // unknown protocol |
| 155 | SC_TEST_EXPECT(not urlParser.parse("http://exa mple.com/path")); |
| 156 | SC_TEST_EXPECT(not urlParser.parse("http://example.com/path\twith-tab")); |
| 157 | SC_TEST_EXPECT(not urlParser.parse("http://example.com/path?bad query")); |
| 158 | SC_TEST_EXPECT(not urlParser.parse("http://example.com/path#bad fragment")); |
| 159 | } |
| 160 | |
| 161 | void SC::HttpURLParserTest::testCaseInsensitive() |
| 162 | { |