29 expectAccepted(
"Watermark \xF0\x9F\x8C\x88", StringKind::DisplayText);
32 expectAccepted(
"preset=p7:rc=vbr_hq", StringKind::StructuredValue);
35 expectRejected([] { validate_string(std::string(
"bad\0path", 8), StringKind::Path,
"test path"); });
36 expectRejected([] { validate_string(
"bad\npath", StringKind::Path,
"test path"); });
37 expectRejected([] { validate_string(
"\xC0\xAF", StringKind::Path,
"test path"); });
38 expectRejected([] { validate_string(
"bad-name", StringKind::Identifier,
"test identifier"); });
39 expectRejected([] { validate_string(
"value;command", StringKind::StructuredValue,
"test value"); });
40 expectRejected([] { validate_string(
"javascript://example", StringKind::Url,
"test URL"); });
41 expectRejected([] { validate_string(
"https://example.com/bad path", StringKind::Url,
"test URL"); });
42 expectRejected([] { validate_string(
"hidden\xE2\x80\xAEtext", StringKind::DisplayText,
"test text"); });
44 throw std::runtime_error(
"UTF-8 truncation split a codepoint");
47 std::istringstream valid_lines(
"\xEF\xBB\xBF"
48 "first\r\nsecond\tvalue\n");
51 throw std::runtime_error(
"bounded line reader rejected a valid line");
54 throw std::runtime_error(
"bounded line reader rejected valid configuration whitespace");
57 std::istringstream long_line(
"123456789\n");
62 std::cout <<
"ACMXVK input validation tests passed\n";