add parser test for word bounded with dash and underscores
This commit is contained in:
@@ -450,6 +450,23 @@ class QueryParserTester
|
|||||||
expect(@result[:DEFAULT_COLUMN]).to eq 'andromeda'
|
expect(@result[:DEFAULT_COLUMN]).to eq 'andromeda'
|
||||||
end
|
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
|
it 'tests query with search term in brackets with AND inside word with quotes' do
|
||||||
@result = @evaluator.parse('("land")')
|
@result = @evaluator.parse('("land")')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user