Commit 9fc02e2f91c856c8b8cd7369ceecd5a89deedb37

Authored by Jay Berkenbilt
1 parent 1ecc6bb2

Add another string parsing test

Showing 1 changed file with 5 additions and 1 deletions
qpdf/test_driver.cc
@@ -3344,12 +3344,16 @@ test_95(QPDF& pdf, char const* arg2) @@ -3344,12 +3344,16 @@ test_95(QPDF& pdf, char const* arg2)
3344 static void 3344 static void
3345 test_96(QPDF& pdf, char const* arg2) 3345 test_96(QPDF& pdf, char const* arg2)
3346 { 3346 {
3347 - // Test edge cases with quoted characters 3347 + // Test edge cases with quoted characters and string parsing.
3348 3348
3349 auto s = R"((\48\418\121\4))"_qpdf; 3349 auto s = R"((\48\418\121\4))"_qpdf;
3350 assert(s.unparseBinary() == "<043821385104>"); 3350 assert(s.unparseBinary() == "<043821385104>");
3351 s = R"((\48\418\121\41))"_qpdf; 3351 s = R"((\48\418\121\41))"_qpdf;
3352 assert(s.unparseBinary() == "<043821385121>"); 3352 assert(s.unparseBinary() == "<043821385121>");
  3353 + s = R"(<a>)"_qpdf;
  3354 + assert(s.unparseBinary() == "<a0>");
  3355 + s = R"(<abc>)"_qpdf;
  3356 + assert(s.unparseBinary() == "<abc0>");
3353 } 3357 }
3354 3358
3355 void 3359 void