198 references to IsMatch
Microsoft.Build (1)
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (1)
89
if (sectionNameMatcher.Value.
IsMatch
(NormalizeWithForwardSlash(filePath)))
Microsoft.Build.BuildCheck.UnitTests (197)
EditorConfig_Tests.cs (197)
126
Assert.True(matcher.
IsMatch
("/abc"));
127
Assert.False(matcher.
IsMatch
("/aabc"));
128
Assert.False(matcher.
IsMatch
("/ abc"));
129
Assert.False(matcher.
IsMatch
("/cabc"));
138
Assert.True(matcher.
IsMatch
("/abc"));
139
Assert.True(matcher.
IsMatch
("/123"));
140
Assert.True(matcher.
IsMatch
("/abc/123"));
149
Assert.True(matcher.
IsMatch
("/abc.cs"));
150
Assert.True(matcher.
IsMatch
("/123.cs"));
151
Assert.True(matcher.
IsMatch
("/dir/subpath.cs"));
155
Assert.True(matcher.
IsMatch
("/dir\\subpath.cs"));
157
Assert.False(matcher.
IsMatch
("/abc.vb"));
166
Assert.True(matcher.
IsMatch
("/abc.cs"));
167
Assert.True(matcher.
IsMatch
("/dir/subpath.cs"));
176
Assert.True(matcher.
IsMatch
("/..."));
177
Assert.True(matcher.
IsMatch
("/subdir/..."));
178
Assert.False(matcher.
IsMatch
("/aaa"));
179
Assert.False(matcher.
IsMatch
("/???"));
180
Assert.False(matcher.
IsMatch
("/abc"));
196
Assert.True(matcher.
IsMatch
("/abcdef"));
197
Assert.True(matcher.
IsMatch
("/ab?def"));
198
Assert.True(matcher.
IsMatch
("/abzdef"));
199
Assert.True(matcher.
IsMatch
("/ab/def"));
200
Assert.True(matcher.
IsMatch
("/ab\\def"));
209
Assert.True(matcher.
IsMatch
("/ab\\c"));
210
Assert.False(matcher.
IsMatch
("/ab/c"));
211
Assert.False(matcher.
IsMatch
("/ab\\\\c"));
220
Assert.True(matcher.
IsMatch
("/*ab/cd**efg*"));
221
Assert.False(matcher.
IsMatch
("/ab/cd**efg*"));
222
Assert.False(matcher.
IsMatch
("/*ab/cd*efg*"));
223
Assert.False(matcher.
IsMatch
("/*ab/cd**ef/gh"));
232
Assert.True(matcher.
IsMatch
("/?a?cde?f"));
233
Assert.True(matcher.
IsMatch
("/???????f"));
234
Assert.False(matcher.
IsMatch
("/aaaaaaaa"));
235
Assert.False(matcher.
IsMatch
("/aa?cde?f"));
236
Assert.False(matcher.
IsMatch
("/?a?cdexf"));
237
Assert.False(matcher.
IsMatch
("/?axcde?f"));
246
Assert.True(matcher.
IsMatch
("/abc{}def"));
247
Assert.True(matcher.
IsMatch
("/subdir/abc{}def"));
248
Assert.False(matcher.
IsMatch
("/abcdef"));
249
Assert.False(matcher.
IsMatch
("/abc}{def"));
258
Assert.True(matcher.
IsMatch
("/abc,def"));
259
Assert.True(matcher.
IsMatch
("/subdir/abc,def"));
260
Assert.False(matcher.
IsMatch
("/abcdef"));
261
Assert.False(matcher.
IsMatch
("/abc\\,def"));
262
Assert.False(matcher.
IsMatch
("/abc`def"));
271
Assert.True(matcher.
IsMatch
("/abc.cs"));
272
Assert.True(matcher.
IsMatch
("/abc.vb"));
273
Assert.True(matcher.
IsMatch
("/abc.fs"));
274
Assert.True(matcher.
IsMatch
("/subdir/abc.cs"));
275
Assert.True(matcher.
IsMatch
("/subdir/abc.vb"));
276
Assert.True(matcher.
IsMatch
("/subdir/abc.fs"));
278
Assert.False(matcher.
IsMatch
("/abcxcs"));
279
Assert.False(matcher.
IsMatch
("/abcxvb"));
280
Assert.False(matcher.
IsMatch
("/abcxfs"));
281
Assert.False(matcher.
IsMatch
("/subdir/abcxcs"));
282
Assert.False(matcher.
IsMatch
("/subdir/abcxcb"));
283
Assert.False(matcher.
IsMatch
("/subdir/abcxcs"));
301
Assert.True(matcher.
IsMatch
("/test.cs"));
302
Assert.True(matcher.
IsMatch
("/subdir/test.vb"));
304
Assert.False(matcher.
IsMatch
("/subdir/test.cs"));
305
Assert.False(matcher.
IsMatch
("/subdir/subdir/test.vb"));
306
Assert.False(matcher.
IsMatch
("/test.vb"));
315
Assert.True(matcher.
IsMatch
("/"));
316
Assert.True(matcher.
IsMatch
("/subdir/"));
317
Assert.False(matcher.
IsMatch
("/."));
318
Assert.False(matcher.
IsMatch
("/anything"));
327
Assert.True(matcher.
IsMatch
("/test.cs"));
328
Assert.True(matcher.
IsMatch
("/subdir/test.cs"));
329
Assert.False(matcher.
IsMatch
("test.vb"));
330
Assert.False(matcher.
IsMatch
("testxcs"));
353
Assert.True(matcher.
IsMatch
("/test.cs"));
354
Assert.True(matcher.
IsMatch
("/test.vb"));
355
Assert.True(matcher.
IsMatch
("/subdir/test.cs"));
356
Assert.True(matcher.
IsMatch
("/subdir/test.vb"));
357
Assert.True(matcher.
IsMatch
("/other.abb"));
358
Assert.True(matcher.
IsMatch
("/other.acc"));
360
Assert.False(matcher.
IsMatch
("/test.fs"));
361
Assert.False(matcher.
IsMatch
("/other.bbb"));
362
Assert.False(matcher.
IsMatch
("/other.ccc"));
363
Assert.False(matcher.
IsMatch
("/subdir/other.bbb"));
364
Assert.False(matcher.
IsMatch
("/subdir/other.ccc"));
373
Assert.True(matcher.
IsMatch
("/ab-cd-ef"));
374
Assert.True(matcher.
IsMatch
("/ab-cdef"));
376
Assert.False(matcher.
IsMatch
("/abcdef"));
377
Assert.False(matcher.
IsMatch
("/ab--cd-ef"));
378
Assert.False(matcher.
IsMatch
("/ab--cd--ef"));
387
Assert.True(matcher.
IsMatch
("/abcscd"));
388
Assert.True(matcher.
IsMatch
("/abvbcd"));
389
Assert.True(matcher.
IsMatch
("/abfscd"));
391
Assert.False(matcher.
IsMatch
("/abcs"));
392
Assert.False(matcher.
IsMatch
("/abcd"));
393
Assert.False(matcher.
IsMatch
("/vbcd"));
409
Assert.True(matcher.
IsMatch
("/0"));
410
Assert.True(matcher.
IsMatch
("/10"));
411
Assert.True(matcher.
IsMatch
("/5"));
412
Assert.True(matcher.
IsMatch
("/000005"));
413
Assert.False(matcher.
IsMatch
("/-1"));
414
Assert.False(matcher.
IsMatch
("/-00000001"));
415
Assert.False(matcher.
IsMatch
("/11"));
426
Assert.True(matcher.
IsMatch
("/0"));
427
Assert.True(matcher.
IsMatch
("/-10"));
428
Assert.True(matcher.
IsMatch
("/-5"));
429
Assert.False(matcher.
IsMatch
("/1"));
430
Assert.False(matcher.
IsMatch
("/-11"));
431
Assert.False(matcher.
IsMatch
("/--0"));
442
Assert.True(matcher.
IsMatch
("/0"));
443
Assert.True(matcher.
IsMatch
("/-5"));
444
Assert.True(matcher.
IsMatch
("/5"));
445
Assert.True(matcher.
IsMatch
("/-10"));
446
Assert.True(matcher.
IsMatch
("/10"));
447
Assert.False(matcher.
IsMatch
("/-11"));
448
Assert.False(matcher.
IsMatch
("/11"));
449
Assert.False(matcher.
IsMatch
("/--0"));
460
Assert.True(matcher.
IsMatch
("/a0b0"));
461
Assert.True(matcher.
IsMatch
("/a-5b0"));
462
Assert.True(matcher.
IsMatch
("/a-5b5"));
463
Assert.True(matcher.
IsMatch
("/a-5b10"));
464
Assert.True(matcher.
IsMatch
("/a-10b10"));
465
Assert.True(matcher.
IsMatch
("/a-10b0"));
466
Assert.True(matcher.
IsMatch
("/a-0b0"));
467
Assert.True(matcher.
IsMatch
("/a-0b-0"));
469
Assert.False(matcher.
IsMatch
("/a-11b10"));
470
Assert.False(matcher.
IsMatch
("/a-11b10"));
471
Assert.False(matcher.
IsMatch
("/a-10b11"));
484
Assert.True(matcher.
IsMatch
("/0.."));
485
Assert.False(matcher.
IsMatch
("/0"));
486
Assert.False(matcher.
IsMatch
("/0."));
487
Assert.False(matcher.
IsMatch
("/0abc"));
490
Assert.True(matcher.
IsMatch
("/0..A"));
491
Assert.False(matcher.
IsMatch
("/0"));
492
Assert.False(matcher.
IsMatch
("/0abc"));
507
Assert.True(matcher.
IsMatch
("/abc.cs"));
508
Assert.True(matcher.
IsMatch
("/abc.fs"));
509
Assert.False(matcher.
IsMatch
("/abc.vs"));
518
Assert.False(matcher.
IsMatch
("/abc.cs"));
519
Assert.False(matcher.
IsMatch
("/abc.fs"));
520
Assert.True(matcher.
IsMatch
("/abc.vs"));
521
Assert.True(matcher.
IsMatch
("/abc.xs"));
522
Assert.False(matcher.
IsMatch
("/abc.vxs"));
531
Assert.True(matcher.
IsMatch
("/abc.cs"));
532
Assert.True(matcher.
IsMatch
("/abc.fs"));
533
Assert.True(matcher.
IsMatch
("/abc.^s"));
534
Assert.False(matcher.
IsMatch
("/abc.vs"));
535
Assert.False(matcher.
IsMatch
("/abc.xs"));
536
Assert.False(matcher.
IsMatch
("/abc.vxs"));
545
Assert.True(matcher.
IsMatch
("/0x"));
546
Assert.True(matcher.
IsMatch
("/1x"));
547
Assert.True(matcher.
IsMatch
("/9x"));
548
Assert.False(matcher.
IsMatch
("/yx"));
549
Assert.False(matcher.
IsMatch
("/00x"));
558
Assert.False(matcher.
IsMatch
("/0x"));
559
Assert.False(matcher.
IsMatch
("/1x"));
560
Assert.False(matcher.
IsMatch
("/9x"));
561
Assert.True(matcher.
IsMatch
("/yx"));
562
Assert.False(matcher.
IsMatch
("/00x"));
571
Assert.True(matcher.
IsMatch
("/ax"));
572
Assert.True(matcher.
IsMatch
("/bx"));
573
Assert.True(matcher.
IsMatch
("/0x"));
574
Assert.True(matcher.
IsMatch
("/1x"));
575
Assert.True(matcher.
IsMatch
("/9x"));
576
Assert.False(matcher.
IsMatch
("/yx"));
577
Assert.False(matcher.
IsMatch
("/0ax"));
606
Assert.True(matcher.
IsMatch
("/abc"));
607
Assert.True(matcher.
IsMatch
("/[bc"));
608
Assert.False(matcher.
IsMatch
("/ab"));
609
Assert.False(matcher.
IsMatch
("/[b"));
610
Assert.False(matcher.
IsMatch
("/bc"));
611
Assert.False(matcher.
IsMatch
("/ac"));
612
Assert.False(matcher.
IsMatch
("/[c"));
622
Assert.True(matcher.
IsMatch
("/abd"));
623
Assert.True(matcher.
IsMatch
("/cbd"));
624
Assert.True(matcher.
IsMatch
("/-bd"));
625
Assert.False(matcher.
IsMatch
("/bbd"));
626
Assert.False(matcher.
IsMatch
("/-cd"));
627
Assert.False(matcher.
IsMatch
("/bcd"));
637
Assert.True(matcher.
IsMatch
("/abd"));
638
Assert.True(matcher.
IsMatch
("/cbd"));
639
Assert.True(matcher.
IsMatch
("/-bd"));
640
Assert.False(matcher.
IsMatch
("/bbd"));
641
Assert.False(matcher.
IsMatch
("/-cd"));
642
Assert.False(matcher.
IsMatch
("/bcd"));
652
Assert.True(matcher.
IsMatch
("/a]cd"));
653
Assert.True(matcher.
IsMatch
("/b]cd"));
654
Assert.False(matcher.
IsMatch
("/acd"));
655
Assert.False(matcher.
IsMatch
("/bcd"));
656
Assert.False(matcher.
IsMatch
("/acd"));
666
Assert.True(matcher.
IsMatch
("/acd"));
667
Assert.True(matcher.
IsMatch
("/bcd"));
668
Assert.True(matcher.
IsMatch
("/\\cd"));
669
Assert.False(matcher.
IsMatch
("/dcd"));
670
Assert.False(matcher.
IsMatch
("/\\\\cd"));
671
Assert.False(matcher.
IsMatch
("/cd"));
681
Assert.True(matcher.
IsMatch
("/ab[cd"));
682
Assert.False(matcher.
IsMatch
("/ab[[cd"));
683
Assert.False(matcher.
IsMatch
("/abc"));
684
Assert.False(matcher.
IsMatch
("/abd"));