File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
RubberduckTests/RegexAssistant Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -210,5 +210,25 @@ public void IgnoresBackreferenceSpecifiers()
210
210
Assert . AreEqual ( expectedSpecifiers [ i ] , cut . CharacterSpecifiers [ i ] ) ;
211
211
}
212
212
}
213
+
214
+ [ Test ]
215
+ // https://github.com/rubberduck-vba/Rubberduck/issues/4839
216
+ public void TrailingEscapedBackslash ( )
217
+ {
218
+ const string pattern = @"[^\w\\]" ;
219
+
220
+ var expression = VBRegexParser . Parse ( pattern ) ;
221
+ Assert . IsInstanceOf ( typeof ( SingleAtomExpression ) , expression ) ;
222
+ var atom = ( expression as SingleAtomExpression ) . Atom ;
223
+ Assert . AreEqual ( new CharacterClass ( @"[^\w\\]" , Quantifier . None ) , atom ) ;
224
+ }
225
+
226
+ [ Test ]
227
+ // https://github.com/rubberduck-vba/Rubberduck/issues/4839
228
+ public void TrailingEscapedBackslashIsConstructible ( )
229
+ {
230
+ const string pattern = @"[^\w\\]" ;
231
+ new CharacterClass ( pattern , Quantifier . None ) ;
232
+ }
213
233
}
214
234
}
You can’t perform that action at this time.
0 commit comments