@@ -58,15 +58,34 @@ describe('extglobs', () => {
58
58
it ( 'should support stars in negation extglobs' , ( ) => {
59
59
assert ( ! isMatch ( '/file.d.ts' , '/!(*.d).ts' ) ) ;
60
60
assert ( isMatch ( '/file.ts' , '/!(*.d).ts' ) ) ;
61
+ assert ( isMatch ( '/file.something.ts' , '/!(*.d).ts' ) ) ;
61
62
assert ( isMatch ( '/file.d.something.ts' , '/!(*.d).ts' ) ) ;
62
63
assert ( isMatch ( '/file.dhello.ts' , '/!(*.d).ts' ) ) ;
63
64
64
65
assert ( ! isMatch ( '/file.d.ts' , '**/!(*.d).ts' ) ) ;
65
66
assert ( isMatch ( '/file.ts' , '**/!(*.d).ts' ) ) ;
67
+ assert ( isMatch ( '/file.something.ts' , '**/!(*.d).ts' ) ) ;
66
68
assert ( isMatch ( '/file.d.something.ts' , '**/!(*.d).ts' ) ) ;
67
69
assert ( isMatch ( '/file.dhello.ts' , '**/!(*.d).ts' ) ) ;
68
70
} ) ;
69
71
72
+ // See https://github.com/micromatch/picomatch/issues/93
73
+ it ( 'should support stars in negation extglobs with expression after closing parenthesis' , ( ) => {
74
+ // Nested expression after closing parenthesis
75
+ assert ( ! isMatch ( '/file.d.ts' , '/!(*.d).{ts,tsx}' ) ) ;
76
+ assert ( isMatch ( '/file.ts' , '/!(*.d).{ts,tsx}' ) ) ;
77
+ assert ( isMatch ( '/file.something.ts' , '/!(*.d).{ts,tsx}' ) ) ;
78
+ assert ( isMatch ( '/file.d.something.ts' , '/!(*.d).{ts,tsx}' ) ) ;
79
+ assert ( isMatch ( '/file.dhello.ts' , '/!(*.d).{ts,tsx}' ) ) ;
80
+
81
+ // Extglob after closing parenthesis
82
+ assert ( ! isMatch ( '/file.d.ts' , '/!(*.d).@(ts)' ) ) ;
83
+ assert ( isMatch ( '/file.ts' , '/!(*.d).@(ts)' ) ) ;
84
+ assert ( isMatch ( '/file.something.ts' , '/!(*.d).@(ts)' ) ) ;
85
+ assert ( isMatch ( '/file.d.something.ts' , '/!(*.d).@(ts)' ) ) ;
86
+ assert ( isMatch ( '/file.dhello.ts' , '/!(*.d).@(ts)' ) ) ;
87
+ } ) ;
88
+
70
89
it ( 'should support negation extglobs in patterns with slashes' , ( ) => {
71
90
assert ( ! isMatch ( 'foo/abc' , 'foo/!(abc)' ) ) ;
72
91
assert ( isMatch ( 'foo/bar' , 'foo/!(abc)' ) ) ;
0 commit comments