File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ const parse = (input, options) => {
247247 output = token . close = `)$))${ extglobStar } ` ;
248248 }
249249
250- if ( token . prev . type === 'bos' && eos ( ) ) {
250+ if ( token . prev . type === 'bos' ) {
251251 state . negatedExtglob = true ;
252252 }
253253 }
Original file line number Diff line number Diff line change @@ -347,4 +347,19 @@ describe('picomatch', () => {
347347 } ) ;
348348 } ) ;
349349 } ) ;
350+
351+ describe ( 'state' , ( ) => {
352+ describe ( 'negatedExtglob' , ( ) => {
353+ it ( 'should return true' , ( ) => {
354+ assert ( picomatch ( '!(abc)' , { } , true ) . state . negatedExtglob ) ;
355+ assert ( picomatch ( '!(abc)**' , { } , true ) . state . negatedExtglob ) ;
356+ assert ( picomatch ( '!(abc)/**' , { } , true ) . state . negatedExtglob ) ;
357+ } ) ;
358+
359+ it ( 'should return false' , ( ) => {
360+ assert ( ! picomatch ( '(!(abc))' , { } , true ) . state . negatedExtglob ) ;
361+ assert ( ! picomatch ( '**!(abc)' , { } , true ) . state . negatedExtglob ) ;
362+ } ) ;
363+ } ) ;
364+ } ) ;
350365} ) ;
You can’t perform that action at this time.
0 commit comments