Merge branch 'main' into ragel-email-parser
This commit is contained in:
commit
7fe00099b5
@ -213,6 +213,8 @@ void default_string_format_check(const std::string &format, const std::string &v
|
|||||||
rfc3339_date_check(value);
|
rfc3339_date_check(value);
|
||||||
} else if (format == "time") {
|
} else if (format == "time") {
|
||||||
rfc3339_time_check(value);
|
rfc3339_time_check(value);
|
||||||
|
} else if (format == "uri") {
|
||||||
|
rfc3986_uri_check(value);
|
||||||
} else if (format == "email") {
|
} else if (format == "email") {
|
||||||
if (!is_ascii(value)) {
|
if (!is_ascii(value)) {
|
||||||
throw std::invalid_argument(value + " contains non-ASCII values, not RFC 5321 compliant.");
|
throw std::invalid_argument(value + " contains non-ASCII values, not RFC 5321 compliant.");
|
||||||
|
|||||||
@ -61,7 +61,6 @@ if(JSON_SCHEMA_TEST_SUITE_PATH)
|
|||||||
JSON-Suite::Optional::Format::relative-json-pointer
|
JSON-Suite::Optional::Format::relative-json-pointer
|
||||||
JSON-Suite::Optional::Format::uri-reference
|
JSON-Suite::Optional::Format::uri-reference
|
||||||
JSON-Suite::Optional::Format::uri-template
|
JSON-Suite::Optional::Format::uri-template
|
||||||
JSON-Suite::Optional::Format::uri
|
|
||||||
JSON-Suite::Optional::unicode
|
JSON-Suite::Optional::unicode
|
||||||
|
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
|
|||||||
@ -82,5 +82,21 @@ int main()
|
|||||||
|
|
||||||
numberOfErrors += testStringFormat("ipv4", ipv4Checks);
|
numberOfErrors += testStringFormat("ipv4", ipv4Checks);
|
||||||
|
|
||||||
|
const std::vector<std::pair<std::string, bool>> uriChecks{
|
||||||
|
{"http://www.google.com/search?q=regular%20expression", true},
|
||||||
|
{"http://www.google.com/", true},
|
||||||
|
{"http://www.google.com/search?q=regular%20expression", true},
|
||||||
|
{"www.google.com", false},
|
||||||
|
{"http://www.google.comj", true},
|
||||||
|
{"ldap://[2001:db8::7]/c=GB?objectClass?one", true},
|
||||||
|
{"mailto:John.Doe@example.com", true},
|
||||||
|
{"news:comp.infosystems.www.servers.unix", true},
|
||||||
|
{"https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top", true},
|
||||||
|
{"tel:+1-816-555-1212", true},
|
||||||
|
{"telnet://192.0.2.16:80/", true},
|
||||||
|
{"urn:oasis:names:specification:docbook:dtd:xml:4.1.2", true}};
|
||||||
|
|
||||||
|
numberOfErrors += testStringFormat("uri", uriChecks);
|
||||||
|
|
||||||
return numberOfErrors;
|
return numberOfErrors;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user