Exemplo n.º 1
0
        public void EscapedTextMatch(NonEscapedText sample)
        {
            string pattern = SreSyntax.Escape(sample.Text);

            Assert.IsTrue(Match(pattern, sample.Text));
            Assert.IsFalse(Match(pattern, sample.Text.Substring(1)));
            Assert.IsFalse(Match(pattern, sample.Text.Substring(0, sample.Text.Length - 1)));
            Assert.IsFalse(Match(pattern, sample.Text + "x"));
            Assert.IsFalse(Match(pattern, "x" + sample.Text));
        }
Exemplo n.º 2
0
 public void EscapedTextMatch(NonEscapedText sample)
 {
     string pattern = SreSyntax.Escape(sample.Text);
     Assert.IsTrue(Match(pattern, sample.Text));
     Assert.IsFalse(Match(pattern, sample.Text.Substring(1)));
     Assert.IsFalse(Match(pattern, sample.Text.Substring(0, sample.Text.Length - 1)));
     Assert.IsFalse(Match(pattern, sample.Text + "x"));
     Assert.IsFalse(Match(pattern, "x" + sample.Text));
 }