add lexer test for word bounded with dash and underscores

This commit is contained in:
Bilal Catic
2020-02-10 13:40:56 +01:00
parent 453131a25b
commit 04a873b1a6

View File

@@ -408,6 +408,19 @@ class QueryLexerTester
expect(@result[2][0]).to eq :R_BRACKET
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
@result = @evaluator.tokenize('land andrew and andromeda or orlando')