Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added tests for negative look-behind.

The tests confirm that negative look-behind was already working.
  • Loading branch information...
commit 6114c045b18fc073f2cf8232eb145f8e1cb43b2d 1 parent e3d7d65
@bfriesen bfriesen authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 RegExpose.Tests/MatchTests.cs
View
18 RegExpose.Tests/MatchTests.cs
@@ -130,12 +130,18 @@ public void PositiveLookBehind(string input, string pattern)
PerformTest(input, pattern, RegexOptions.None);
}
- //[TestCase("foobar", @"foo(?!bar)")]
- //[TestCase("foobaz", @"foo(?!bar)")]
- //public void NegativeLookBehind(string input, string pattern)
- //{
- // PerformTest(input, pattern, RegexOptions.None);
- //}
+ [TestCase("USD100", @"\d{3}(?<!USD\d{3})")]
+ [TestCase("USD100", @"(?<!USD)\d{3}")]
+ [TestCase("blah USD100 blah", @"\d{3}(?<!USD\d{3})")]
+ [TestCase("blah USD100 blah", @"(?<!USD)\d{3}")]
+ [TestCase("JPY100", @"\d{3}(?<!USD\d{3})")]
+ [TestCase("JPY100", @"(?<!USD)\d{3}")]
+ [TestCase("blah JPY100 blah", @"\d{3}(?<!USD\d{3})")]
+ [TestCase("blah JPY100 blah", @"(?<!USD)\d{3}")]
+ public void NegativeLookBehind(string input, string pattern)
+ {
+ PerformTest(input, pattern, RegexOptions.None);
+ }
[TestCase("<a><b>c</b></c>", @"<(\w+)>[^<]*?</\1>")]
public void CapturingParenLazyStarAndBackreference(string input, string pattern)
Please sign in to comment.
Something went wrong with that request. Please try again.