Handle lexing of input such as just "</".

Previously this would cause the lexer to go in an infinite loop in the "text"
state machine.

This fixes #37.
This commit is contained in:
Yorick Peterse committed 2014-09-15 17:20:06 +02:00
1 parent b06eadc812
commit ad2e040f05
2 files changed
+20

No files matched your search

+12
View File
@@ -21,5 +21,17 @@ describe Oga::XML::Lexer do
example 'lex a > as regular text' do
lex('>').should == [[:T_TEXT, '>', 1]]
end
example 'lex </ as regular text' do
lex('</').should == [[:T_TEXT, '</', 1]]
end
example 'lex <! as regular text' do
lex('<!').should == [[:T_TEXT, '<!', 1]]
end
example 'lex <? as regular text' do
lex('<?').should == [[:T_TEXT, '<?', 1]]
end
end
end