add lexer test for word bounded with dash and underscores
This commit is contained in:
@@ -408,6 +408,19 @@ class QueryLexerTester
|
|||||||
expect(@result[2][0]).to eq :R_BRACKET
|
expect(@result[2][0]).to eq :R_BRACKET
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'tests query with multiple search terms with mixed and-or-not after dash and underscore' do
|
||||||
|
@result = @evaluator.tokenize('123-and-456 -or-2 -not_not_1')
|
||||||
|
|
||||||
|
expect(@result.length).to eq 3
|
||||||
|
|
||||||
|
expect(@result[0][0]).to eq :TERM_WITHOUT_QUOTES
|
||||||
|
expect(@result[0][1]).to eq '123-and-456'
|
||||||
|
expect(@result[1][0]).to eq :TERM_WITHOUT_QUOTES
|
||||||
|
expect(@result[1][1]).to eq '-or-2'
|
||||||
|
expect(@result[2][0]).to eq :TERM_WITHOUT_QUOTES
|
||||||
|
expect(@result[2][1]).to eq '-not_not_1'
|
||||||
|
end
|
||||||
|
|
||||||
it 'tests query with multiple search terms starting with AND' do
|
it 'tests query with multiple search terms starting with AND' do
|
||||||
@result = @evaluator.tokenize('land andrew and andromeda or orlando')
|
@result = @evaluator.tokenize('land andrew and andromeda or orlando')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user