@@ -331,6 +331,7 @@ describe("GitHub repository search", () => {
331331 ] ,
332332 [ checkout . root , 'query="(is:pr) is:open"' , "parentheses" ] ,
333333 [ checkout . root , 'query="is:pr is:open OR label:bug"' , "Boolean operators" ] ,
334+ [ checkout . root , 'query="is:pr NOT label:bug"' , "Boolean operators" ] ,
334335 [ checkout . root , 'query="is:pr"' , "has not authorized" ] ,
335336 [ local . root , 'query="is:pr"' , "does not name a GitHub repository" ] ,
336337 [ outside , 'query="is:pr"' , "repository" ] ,
@@ -348,6 +349,28 @@ describe("GitHub repository search", () => {
348349 expect ( provider . requests ) . toEqual ( [ ] ) ;
349350 } ) ;
350351
352+ it ( "forwards native Boolean operators on search terms" , function * ( ) {
353+ const remote = yield * useBareRemote ( REMOTE ) ;
354+ const checkout = yield * useNamedOriginCheckout ( remote , REPOSITORY ) ;
355+ const root = yield * useTempDirectory ( "github-search" ) ;
356+ const provider = searchProvider ( [ REPOSITORY ] , ( ) => ( {
357+ status : 200 ,
358+ body : JSON . stringify ( { ...FIRST_PAGE , total_count : 1 } ) ,
359+ } ) ) ;
360+ const queries = [ "is:pr NOT wip" , "is:pr foo OR bar" ] ;
361+ const source = queries
362+ . map ( ( query , index ) => `<GitHub.Search query={${ JSON . stringify ( query ) } } as="page${ index } " />` )
363+ . join ( "\n" ) ;
364+ yield * runOrdinaryDocument ( source , {
365+ cwd : checkout . root ,
366+ root,
367+ gitHubPullRequests : provider . options ,
368+ } ) ;
369+ expect ( provider . requests . map ( ( { url } ) => new URL ( url ) . searchParams . get ( "q" ) ) ) . toEqual (
370+ queries . map ( ( query ) => `repo:octo/project ${ query } ` ) ,
371+ ) ;
372+ } ) ;
373+
351374 it ( "binds all 30 items on page 34 when GitHub returns a full terminal page" , function * ( ) {
352375 const remote = yield * useBareRemote ( REMOTE ) ;
353376 const checkout = yield * useNamedOriginCheckout ( remote , REPOSITORY ) ;
0 commit comments