2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Add another string parsing test

This commit is contained in:
Jay Berkenbilt 2023-10-14 17:31:46 -04:00
parent 1ecc6bb29e
commit 9fc02e2f91

View File

@ -3344,12 +3344,16 @@ test_95(QPDF& pdf, char const* arg2)
static void
test_96(QPDF& pdf, char const* arg2)
{
// Test edge cases with quoted characters
// Test edge cases with quoted characters and string parsing.
auto s = R"((\48\418\121\4))"_qpdf;
assert(s.unparseBinary() == "<043821385104>");
s = R"((\48\418\121\41))"_qpdf;
assert(s.unparseBinary() == "<043821385121>");
s = R"(<a>)"_qpdf;
assert(s.unparseBinary() == "<a0>");
s = R"(<abc>)"_qpdf;
assert(s.unparseBinary() == "<abc0>");
}
void