Renamed CSS axis tokens.
These have been renamed as following: T_CHILD => T_GREATER T_FOLLOWING => T_TILDE T_FOLLOWING_DIRECT => T_PLUS
This commit is contained in:
1 parent
823f2f1bad
commit
9955f61bcb
3 files changed
+21
-21
No files matched your search
@@ -3,52 +3,52 @@ require 'spec_helper'
|
||||
describe Oga::CSS::Lexer do
|
||||
context 'axes' do
|
||||
example 'lex the > axis' do
|
||||
lex_css('>').should == [[:T_CHILD, nil]]
|
||||
lex_css('>').should == [[:T_GREATER, nil]]
|
||||
end
|
||||
|
||||
example 'lex the expression "> y"' do
|
||||
lex_css('> y').should == [[:T_CHILD, nil], [:T_IDENT, 'y']]
|
||||
lex_css('> y').should == [[:T_GREATER, nil], [:T_IDENT, 'y']]
|
||||
end
|
||||
|
||||
example 'lex the expression "x > y"' do
|
||||
lex_css('x > y').should == [
|
||||
[:T_IDENT, 'x'],
|
||||
[:T_SPACE, nil],
|
||||
[:T_CHILD, nil],
|
||||
[:T_GREATER, nil],
|
||||
[:T_IDENT, 'y']
|
||||
]
|
||||
end
|
||||
|
||||
example 'lex the + axis' do
|
||||
lex_css('+').should == [[:T_FOLLOWING_DIRECT, nil]]
|
||||
lex_css('+').should == [[:T_PLUS, nil]]
|
||||
end
|
||||
|
||||
example 'lex the expression "+ y"' do
|
||||
lex_css('+ y').should == [[:T_FOLLOWING_DIRECT, nil], [:T_IDENT, 'y']]
|
||||
lex_css('+ y').should == [[:T_PLUS, nil], [:T_IDENT, 'y']]
|
||||
end
|
||||
|
||||
example 'lex the expression "x + y"' do
|
||||
lex_css('x + y').should == [
|
||||
[:T_IDENT, 'x'],
|
||||
[:T_SPACE, nil],
|
||||
[:T_FOLLOWING_DIRECT, nil],
|
||||
[:T_PLUS, nil],
|
||||
[:T_IDENT, 'y']
|
||||
]
|
||||
end
|
||||
|
||||
example 'lex the ~ axis' do
|
||||
lex_css('~').should == [[:T_FOLLOWING, nil]]
|
||||
lex_css('~').should == [[:T_TILDE, nil]]
|
||||
end
|
||||
|
||||
example 'lex the expression "~ y"' do
|
||||
lex_css('~ y').should == [[:T_FOLLOWING, nil], [:T_IDENT, 'y']]
|
||||
lex_css('~ y').should == [[:T_TILDE, nil], [:T_IDENT, 'y']]
|
||||
end
|
||||
|
||||
example 'lex the expression "x ~ y"' do
|
||||
lex_css('x ~ y').should == [
|
||||
[:T_IDENT, 'x'],
|
||||
[:T_SPACE, nil],
|
||||
[:T_FOLLOWING, nil],
|
||||
[:T_TILDE, nil],
|
||||
[:T_IDENT, 'y']
|
||||
]
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user