Added scanner. (#410)

This commit is contained in:
Branimir Karadžić
2026-07-25 12:23:58 -07:00
committed by GitHub
parent cd6720ce9a
commit 9916e720fc
21 changed files with 2157 additions and 1899 deletions

View File

@@ -41,6 +41,39 @@ static const UrlTest s_urlTest[] =
, "file:///d:/tmp/archive.tar.gz",
{ "file", "", "", "", "", "/d:/tmp/archive.tar.gz", "", "" },
},
{ true
, "scheme://host.rs/path#fragment",
{ "scheme", "", "", "host.rs", "", "/path", "", "fragment" },
},
{ true
, "scheme://host.rs/path?query#fragment",
{ "scheme", "", "", "host.rs", "", "/path", "query", "fragment" },
},
{ true
, "scheme://host.rs/path?",
{ "scheme", "", "", "host.rs", "", "/path", "", "" },
},
{ true
, "scheme://username:password@host.rs/",
{ "scheme", "username", "password", "host.rs", "", "/", "", "" },
},
{ true
, "scheme://host.rs",
{ "scheme", "", "", "host.rs", "", "", "", "" },
},
{ false // Fragment must not precede query.
, "scheme://host.rs/path#fragment?query",
{ "", "", "", "", "", "", "", "" },
},
{ false // Neither scheme nor path.
, "host.rs",
{ "", "", "", "", "", "", "", "" },
},
{ false // Scheme must be alpha.
, "1scheme://host.rs/",
{ "", "", "", "", "", "", "", "" },
},
};
TEST_CASE("tokenizeUrl", "[url][string]")