예제 #1
0
        public void ColorspaceParserError()
        {
            var parser         = new CodespaceRangeParser();
            var byteArrayInput = new ByteArrayInputBytes(OtherEncodings.StringAsLatin1Bytes("1 begincodespacerange\nendcodespacerange"));
            var tokenScanner   = new CoreTokenScanner(byteArrayInput);

            Assert.True(tokenScanner.MoveNext());
            Assert.True(tokenScanner.CurrentToken is NumericToken);
            var numeric = (NumericToken)tokenScanner.CurrentToken;

            Assert.True(tokenScanner.MoveNext());
            Assert.True(tokenScanner.CurrentToken is OperatorToken);
            var opToken = (OperatorToken)tokenScanner.CurrentToken;

            Assert.Equal("begincodespacerange", opToken.Data);

            var cmapBuilder = new CharacterMapBuilder();

            parser.Parse(numeric, tokenScanner, cmapBuilder);

            Assert.Empty(cmapBuilder.CodespaceRanges);
        }