@@ -60,6 +60,16 @@ const persons: readonly Person[] = [
6060 phoneNumber : '404-050-2611' ,
6161 subscribed : true ,
6262 } ,
63+ {
64+ height : 150 ,
65+ name : 'foo bar' ,
66+ nick : 'old dog' ,
67+ } ,
68+ {
69+ height : 194 ,
70+ name : 'fox' ,
71+ nick : 'quick fox' ,
72+ } ,
6373] ;
6474
6575const testQuery = test . macro ( ( t , expectedResultNames : string [ ] ) => {
@@ -90,14 +100,14 @@ test('height:[200 TO 225]', testQuery, ['robert', 'noah']);
90100test ( 'height:[200 TO 225}' , testQuery , [ 'robert' ] ) ;
91101test ( 'height:{220 TO 225}' , testQuery , [ ] ) ;
92102
93- test ( 'NOT David' , testQuery , [ 'john' , 'mike' , 'robert' , 'noah' ] ) ;
94- test ( '-David' , testQuery , [ 'john' , 'mike' , 'robert' , 'noah' ] ) ;
103+ test ( 'NOT David' , testQuery , [ 'john' , 'mike' , 'robert' , 'noah' , 'foo bar' , 'fox' ] ) ;
104+ test ( '-David' , testQuery , [ 'john' , 'mike' , 'robert' , 'noah' , 'foo bar' , 'fox' ] ) ;
95105test ( 'David OR John' , testQuery , [ 'david' , 'john' , 'noah' ] ) ;
96106test ( 'Noah AND John' , testQuery , [ 'noah' ] ) ;
97107test ( 'John AND NOT Noah' , testQuery , [ 'john' ] ) ;
98- test ( 'David OR NOT John' , testQuery , [ 'david' , 'mike' , 'robert' ] ) ;
108+ test ( 'David OR NOT John' , testQuery , [ 'david' , 'mike' , 'robert' , 'foo bar' , 'fox' ] ) ;
99109test ( 'John AND -Noah' , testQuery , [ 'john' ] ) ;
100- test ( 'David OR -John' , testQuery , [ 'david' , 'mike' , 'robert' ] ) ;
110+ test ( 'David OR -John' , testQuery , [ 'david' , 'mike' , 'robert' , 'foo bar' , 'fox' ] ) ;
101111
102112test ( 'name:David OR John' , testQuery , [ 'david' , 'john' , 'noah' ] ) ;
103113
@@ -131,3 +141,9 @@ test('phoneNumber:"404-050-2611"', testQuery, ['noah']);
131141test ( 'phoneNumber:404' , testQuery , [ 'noah' ] ) ;
132142
133143test ( 'balance:364' , testQuery , [ 'noah' ] ) ;
144+
145+ test ( '(David)' , testQuery , [ 'david' ] ) ;
146+ test ( '(name:david OR name:john)' , testQuery , [ 'david' , 'john' ] ) ;
147+ test ( '(name:"foo bar" AND nick:"quick fox") OR name:fox' , testQuery , [ 'fox' ] ) ;
148+ test ( '(name:fox OR name:"foo bar" AND nick:"old dog")' , testQuery , [ 'foo bar' ] ) ;
149+ test ( '(name:fox OR (name:"foo bar" AND nick:"old dog"))' , testQuery , [ 'fox' , 'foo bar' ] ) ;
0 commit comments