Test NOT with parenthesis

This commit is contained in:
Matt Sherman 2023-10-04 09:52:54 -04:00
parent 99b06b67a2
commit e7e9e30884
1 changed files with 9 additions and 1 deletions

View File

@ -232,6 +232,14 @@ describe( 'evaluate', () => {
expect( result ).toEqual( true );
} );
it( 'should evaluate a NOT expression with parentheses', () => {
const result = evaluate( '!( foo )', {
foo: true,
} );
expect( result ).toEqual( false );
} );
it( 'should evaluate a multiline expression', () => {
const result = evaluate(
`foo
@ -262,7 +270,7 @@ describe( 'evaluate', () => {
expect( result ).toEqual( true );
} );
it( 'should evaluate an expression with too many parentheses', () => {
it( 'should evaluate an expression with needless parentheses', () => {
const result = evaluate( '(((foo)))', {
foo: true,
} );