Exemple #1
0
        public void TestBacktrackingSuppressionNodeNullExpressionAssignment2()
        {
            RegexNodeBacktrackingSuppression alternation = new RegexNodeBacktrackingSuppression(new RegexNodeLiteral("a"));

            alternation.InnerExpression = null;
            Assert.IsNull(alternation);
        }
        public void TestBacktrackingSuppressionNodeRendering()
        {
            RegexNodeLiteral literal1 = new RegexNodeLiteral("\\w*");

            RegexNodeBacktrackingSuppression suppression1 = new RegexNodeBacktrackingSuppression(literal1);
            Assert.AreEqual("(?>\\w*)", suppression1.ToRegexPattern());

            RegexNodeBacktrackingSuppression suppression2 = new RegexNodeBacktrackingSuppression(literal1);
            suppression2.Quantifier = RegexQuantifier.ZeroOrMore;
            Assert.AreEqual("(?>\\w*)*", suppression2.ToRegexPattern());

            RegexNodeBacktrackingSuppression suppression3 = RegexBuilder.BacktrackingSuppression(literal1);
            Assert.AreEqual("(?>\\w*)", suppression3.ToRegexPattern());

            RegexNodeBacktrackingSuppression suppression4 = RegexBuilder.BacktrackingSuppression(literal1, RegexQuantifier.ZeroOrMore);
            suppression4.Quantifier = RegexQuantifier.ZeroOrMore;
            Assert.AreEqual("(?>\\w*)*", suppression2.ToRegexPattern());
        }
        public void TestBacktrackingSuppressionNodeRendering()
        {
            RegexNodeLiteral literal1 = new RegexNodeLiteral("\\w*");

            RegexNodeBacktrackingSuppression suppression1 = new RegexNodeBacktrackingSuppression(literal1);

            Assert.AreEqual("(?>\\w*)", suppression1.ToRegexPattern());

            RegexNodeBacktrackingSuppression suppression2 = new RegexNodeBacktrackingSuppression(literal1);

            suppression2.Quantifier = RegexQuantifier.ZeroOrMore;
            Assert.AreEqual("(?>\\w*)*", suppression2.ToRegexPattern());

            RegexNodeBacktrackingSuppression suppression3 = RegexBuilder.BacktrackingSuppression(literal1);

            Assert.AreEqual("(?>\\w*)", suppression3.ToRegexPattern());

            RegexNodeBacktrackingSuppression suppression4 = RegexBuilder.BacktrackingSuppression(literal1, RegexQuantifier.ZeroOrMore);

            suppression4.Quantifier = RegexQuantifier.ZeroOrMore;
            Assert.AreEqual("(?>\\w*)*", suppression2.ToRegexPattern());
        }
 public void TestBacktrackingSuppressionNodeNullExpressionAssignment2()
 {
     RegexNodeBacktrackingSuppression alternation = new RegexNodeBacktrackingSuppression(new RegexNodeLiteral("a"));
     alternation.InnerExpression = null;
     Assert.IsNull(alternation);
 }
 public void TestBacktrackingSuppressionNodeNullExpressionAssignment1()
 {
     RegexNodeBacktrackingSuppression alternation = new RegexNodeBacktrackingSuppression(null);
     Assert.IsNull(alternation);
 }
Exemple #6
0
        public void TestBacktrackingSuppressionNodeNullExpressionAssignment1()
        {
            RegexNodeBacktrackingSuppression alternation = new RegexNodeBacktrackingSuppression(null);

            Assert.IsNull(alternation);
        }