diff --git a/spec/query_parser_spec.rb b/spec/query_parser_spec.rb index 63356b4..8ab2ac7 100644 --- a/spec/query_parser_spec.rb +++ b/spec/query_parser_spec.rb @@ -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")')