Skip to content

Commit

Permalink
test: - Update two tests that I could have updated in #2762
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Apr 9, 2024
1 parent df69ed1 commit 646b6ce
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/Query/Filter/BooleanPreprocessor.test.ts
Expand Up @@ -2,7 +2,7 @@ import { BooleanPreprocessor } from '../../../src/Query/Filter/BooleanPreprocess
import { BooleanDelimiters } from '../../../src/Query/Filter/BooleanDelimiters';

function preprocess(line: string) {
return BooleanPreprocessor.preprocessExpression(line, BooleanDelimiters.allSupportedDelimiters());
return BooleanPreprocessor.preprocessExpression(line, BooleanDelimiters.fromInstructionLine(line));
}

describe('BooleanPreprocessor', () => {
Expand Down Expand Up @@ -130,16 +130,14 @@ describe('BooleanPreprocessor', () => {
describe('filters ending with delimiters', () => {
it('swallows last character if filter ends with closing delimiter character )', () => {
const result = preprocess('"description includes (maybe)"');
// TODO Fix imbalanced delimiters by requiring the same delimiter set to be used in Boolean lines.
expect(result.simplifiedLine).toEqual('"f1)"');
expect(result.filters['f1']).toEqual('description includes (maybe');
expect(result.simplifiedLine).toEqual('"f1"');
expect(result.filters['f1']).toEqual('description includes (maybe)');
});

it('swallows last character if filter ends with closing delimiter character "', () => {
const result = preprocess('(description includes "maybe")');
// TODO Fix imbalanced delimiters by requiring the same delimiter set to be used in Boolean lines.
expect(result.simplifiedLine).toEqual('(f1")');
expect(result.filters['f1']).toEqual('description includes "maybe');
expect(result.simplifiedLine).toEqual('(f1)');
expect(result.filters['f1']).toEqual('description includes "maybe"');
});
});

Expand Down

0 comments on commit 646b6ce

Please sign in to comment.