@@ -112,23 +112,29 @@ public void TestBackupOriginalModule()
112112 Assert . True ( File . Exists ( backupPath ) ) ;
113113 }
114114
115- [ Fact ]
116- public void TestIsValidFilterExpression ( )
115+ [ Theory ]
116+ [ InlineData ( "[*]*" ) ]
117+ [ InlineData ( "[*]*core" ) ]
118+ [ InlineData ( "[assembly]*" ) ]
119+ [ InlineData ( "[*]type" ) ]
120+ [ InlineData ( "[assembly]type" ) ]
121+ [ InlineData ( "[coverlet.*.tests?]*" ) ]
122+ [ InlineData ( "[*]Coverlet.Core*" ) ]
123+ [ InlineData ( "[coverlet.*]*" ) ]
124+ public void TestIsValidFilterExpression ( string pattern )
125+ {
126+ Assert . True ( _instrumentationHelper . IsValidFilterExpression ( pattern ) ) ;
127+ }
128+
129+ [ Theory ]
130+ [ InlineData ( "[*]" ) ]
131+ [ InlineData ( "[-]*" ) ]
132+ [ InlineData ( "*" ) ]
133+ [ InlineData ( "][" ) ]
134+ [ InlineData ( null ) ]
135+ public void TestInValidFilterExpression ( string pattern )
117136 {
118- Assert . True ( _instrumentationHelper . IsValidFilterExpression ( "[*]*" ) ) ;
119- Assert . True ( _instrumentationHelper . IsValidFilterExpression ( "[*]*core" ) ) ;
120- Assert . True ( _instrumentationHelper . IsValidFilterExpression ( "[assembly]*" ) ) ;
121- Assert . True ( _instrumentationHelper . IsValidFilterExpression ( "[*]type" ) ) ;
122- Assert . True ( _instrumentationHelper . IsValidFilterExpression ( "[assembly]type" ) ) ;
123- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "[*]" ) ) ;
124- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "[-]*" ) ) ;
125- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "*" ) ) ;
126- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "][" ) ) ;
127- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "[" ) ) ;
128- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "[assembly][*" ) ) ;
129- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "[assembly]*]" ) ) ;
130- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( "[]" ) ) ;
131- Assert . False ( _instrumentationHelper . IsValidFilterExpression ( null ) ) ;
137+ Assert . False ( _instrumentationHelper . IsValidFilterExpression ( pattern ) ) ;
132138 }
133139
134140 [ Fact ]
0 commit comments