Exemplo n.º 1
0
        public void TestInlineOptionNodeQuantifierAssignment()
        {
            RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.Multiline, new RegexNodeLiteral("abc"));

            option.Quantifier = RegexQuantifier.OneOrMore;
            Assert.IsNull(option);
        }
        public void TestInlineOptionNodeRendering()
        {
            RegexNodeLiteral      literal = new RegexNodeLiteral(@"ab\wc{0}");
            RegexNodeInlineOption option1 = new RegexNodeInlineOption(RegexOptions.IgnoreCase, literal);

            Assert.AreEqual(@"(?i:ab\wc{0})", option1.ToRegexPattern());

            RegexNodeInlineOption option2 = new RegexNodeInlineOption(RegexOptions.Singleline | RegexOptions.IgnoreCase, literal);

            Assert.AreEqual(@"(?is:ab\wc{0})", option2.ToRegexPattern());

            RegexNodeInlineOption option3 = new RegexNodeInlineOption(RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace, literal);

            Assert.AreEqual(@"(?mx:ab\wc{0})", option3.ToRegexPattern());

            RegexNodeInlineOption option4 = new RegexNodeInlineOption(RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace, literal);

            Assert.AreEqual(@"(?nx:ab\wc{0})", option4.ToRegexPattern());
        }
Exemplo n.º 3
0
 public void TestInlineOptionNodeQuantifierAssignment()
 {
     RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.Multiline, new RegexNodeLiteral("abc"));
     option.Quantifier = RegexQuantifier.OneOrMore;
     Assert.IsNull(option);
 }
Exemplo n.º 4
0
 public void TestInlineOptionNodeNullExpressionAssignment()
 {
     RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.Multiline, null);
     Assert.IsNull(option);
 }
Exemplo n.º 5
0
 public void TestInlineOptionNodeInvalidOptionAssignment5()
 {
     RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.Compiled, new RegexNodeLiteral("abc"));
     Assert.IsNull(option);
 }
Exemplo n.º 6
0
 public void TestInlineOptionNodeInvalidOptionAssignment4()
 {
     RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.RightToLeft, new RegexNodeLiteral("abc"));
     Assert.IsNull(option);
 }
Exemplo n.º 7
0
 public void TestInlineOptionNodeInvalidOptionAssignment3()
 {
     RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.ECMAScript, new RegexNodeLiteral("abc"));
     Assert.IsNull(option);
 }
Exemplo n.º 8
0
 public void TestInlineOptionNodeInvalidOptionAssignment2()
 {
     RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.CultureInvariant, new RegexNodeLiteral("abc"));
     Assert.IsNull(option);
 }
Exemplo n.º 9
0
        public void TestInlineOptionNodeInvalidOptionAssignment5()
        {
            RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.Compiled, new RegexNodeLiteral("abc"));

            Assert.IsNull(option);
        }
Exemplo n.º 10
0
        public void TestInlineOptionNodeInvalidOptionAssignment4()
        {
            RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.RightToLeft, new RegexNodeLiteral("abc"));

            Assert.IsNull(option);
        }
Exemplo n.º 11
0
        public void TestInlineOptionNodeInvalidOptionAssignment3()
        {
            RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.ECMAScript, new RegexNodeLiteral("abc"));

            Assert.IsNull(option);
        }
Exemplo n.º 12
0
        public void TestInlineOptionNodeInvalidOptionAssignment2()
        {
            RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.CultureInvariant, new RegexNodeLiteral("abc"));

            Assert.IsNull(option);
        }
Exemplo n.º 13
0
        public void TestInlineOptionNodeNullExpressionAssignment()
        {
            RegexNodeInlineOption option = new RegexNodeInlineOption(RegexOptions.Multiline, null);

            Assert.IsNull(option);
        }
        public void TestInlineOptionNodeRendering()
        {
            RegexNodeLiteral literal = new RegexNodeLiteral(@"ab\wc{0}");
            RegexNodeInlineOption option1 = new RegexNodeInlineOption(RegexOptions.IgnoreCase, literal);
            Assert.AreEqual(@"(?i:ab\wc{0})", option1.ToRegexPattern());

            RegexNodeInlineOption option2 = new RegexNodeInlineOption(RegexOptions.Singleline | RegexOptions.IgnoreCase, literal);
            Assert.AreEqual(@"(?is:ab\wc{0})", option2.ToRegexPattern());

            RegexNodeInlineOption option3 = new RegexNodeInlineOption(RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace, literal);
            Assert.AreEqual(@"(?mx:ab\wc{0})", option3.ToRegexPattern());

            RegexNodeInlineOption option4 = new RegexNodeInlineOption(RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace, literal);
            Assert.AreEqual(@"(?nx:ab\wc{0})", option4.ToRegexPattern());
        }