add parser test for word bounded with dash and underscores

This commit is contained in:
Bilal Catic
2020-02-10 13:44:55 +01:00
parent 04a873b1a6
commit e05e9e86f9

View File

@@ -450,6 +450,23 @@ class QueryParserTester
expect(@result[:DEFAULT_COLUMN]).to eq 'andromeda'
end
it 'tests query with multiple search terms with mixed and-or-not after dash and underscore' do
@result = @evaluator.parse('123-and-456 -or-2 -not_not_1')
@or_array_1 = [
{:DEFAULT_COLUMN => '-or-2'},
{:DEFAULT_COLUMN => '-not_not_1'}
]
@last_or_array = [
{:DEFAULT_COLUMN => '123-and-456'},
{:OPERATOR_OR => @or_array_1}
]
expect(@result.length).to eq 1
expect(@result[:OPERATOR_OR]).to eq @last_or_array
end
it 'tests query with search term in brackets with AND inside word with quotes' do
@result = @evaluator.parse('("land")')