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:
parent
f4ae83498e
commit
f2fe2a4b47
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue