public void TestMultiCharText() { var t = new TextPattern(@"\a"); Assert.AreEqual(t.Expression, @"\\a"); var t2 = t.Repeat(2, 3); Assert.AreEqual(t2.Expression, @"(?:\\a){2,3}"); }
public void TestOneCharText() { var t = new TextPattern("a"); Assert.AreEqual(t.Expression, "a"); var t2 = t.Repeat(2, 3); Assert.AreEqual(t2.Expression, "a{2,3}"); }
public void TestOneEscapedCharText() { var t = new TextPattern(@"\"); Assert.AreEqual(t.Expression, @"\\"); var t2 = t.Repeat(2, 3); Assert.AreEqual(t2.Expression, @"\\{2,3}"); }
public void TestNullText() { var t = new TextPattern(); Assert.AreEqual(t.Expression, ""); var t2 = t.Repeat(2, 3); Assert.AreEqual(t2.Expression, ""); }