FIX : undefined references is a valid use case.

I tried to mitigate the breaking change by keep on throwing in most uses of the change method.
This commit is contained in:
romain v
2020-08-17 11:10:44 +02:00
parent dc55fd8011
commit 5a82c36631
9 changed files with 48 additions and 33 deletions

View File

@@ -50,6 +50,36 @@ endobj";
var reference = Assert.IsType<IndirectReferenceToken>(token.Data);
Assert.Equal(new IndirectReference(12, 7), reference.Data);
}
[Fact]
public void ReadsObjectWithUndefinedIndirectReference()
{
const string s = @"
5 0 obj
<<
/XObject <<
/Pic1 7 0 R
>>
/ProcSet [/PDF /Text /ImageC ]
/Font <<
/F0 8 0 R
/F1 9 0 R
/F2 10 0 R
/F3 0 0 R
>>
>>
endobj";
var scanner = GetScanner(s);
ReadToEnd(scanner);
var token = scanner.Get(new IndirectReference(5, 0));
Assert.NotNull(token);
token = scanner.Get(new IndirectReference(0, 0));
Assert.Null(token);
}
[Fact]