Exemple #1
0
        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}");
        }
Exemple #2
0
        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}");
        }
Exemple #3
0
        public void TestOneEscapedCharText()
        {
            var t = new TextPattern(@"\");

            Assert.AreEqual(t.Expression, @"\\");
            var t2 = t.Repeat(2, 3);

            Assert.AreEqual(t2.Expression, @"\\{2,3}");
        }
Exemple #4
0
        public void TestNullText()
        {
            var t = new TextPattern();

            Assert.AreEqual(t.Expression, "");
            var t2 = t.Repeat(2, 3);

            Assert.AreEqual(t2.Expression, "");
        }