added another complex testcase for parsing

This commit is contained in:
ari committed 2020-10-17 22:24:14 -04:00
1 parent 4f8bcf1fff
commit 0f147bb66a
1 file changed
+22
+22
View File
@@ -48,3 +48,25 @@ class Basic(TestCase):
self.assertListEqual(
obj, [549, Decimal("3.14"), False, " Ralph ", PDFName("SomeName")]
)
def test_parse_nested_array(self):
parser = PDFParser(
io.BytesIO(
br"""[ [10 30] [22 33] [
<< /x 0 /y 5 >>
<< /x 10 /y 5 >>
] ]"""
)
)
obj = next(parser.iter_objects())
self.assertListEqual(
obj,
[
[10, 30],
[22, 33],
[
{PDFName("x"): 0, PDFName("y"): 5},
{PDFName("x"): 10, PDFName("y"): 5},
],
],
)