Failing XPath spec for double slashes.

The lexer doesn't lex things correctly due to "//" and "/" both being separate
rules. As a result the lexer emits two T_SLASH tokens for queries such as
".//foo".
This commit is contained in:
Yorick Peterse 2014-08-13 00:37:12 +02:00
parent f4ae83498e
commit f2fe2a4b47
1 changed files with 11 additions and 0 deletions

View File

@ -147,5 +147,16 @@ describe Oga::XPath::Lexer do
[:T_RPAREN, nil],
]
end
example 'lex the . axis followed by a path' do
lex_xpath('./foo').should == [
[:T_AXIS, 'self'],
[:T_IDENT, 'node'],
[:T_LPAREN, nil],
[:T_RPAREN, nil],
[:T_SLASH, nil],
[:T_IDENT, 'foo']
]
end
end
end