示例#1
0
        public void Parse_WithPlusInConcatination_ReturnsExpectedTree()
        {
            // Arrange
            var pattern = "ab+c";

            // Act
            var regex = Regex.Parse(pattern);

            // Assert
            regex.Tree.AssertConcatenation(
                TreeAssert.Char('a'),
                TreeAssert.Concat(
                    TreeAssert.Plus(
                        TreeAssert.Char('b')),
                    TreeAssert.Char('c')));
        }
示例#2
0
        public void Parse_WithRequiredRepeatingGroupedAlternativesInConcatination_ReturnsExpectedTree()
        {
            // Arrange
            var pattern = "a(b|c)+d";

            // Act
            var regex = Regex.Parse(pattern);

            // Assert
            regex.Tree.AssertConcatenation(
                TreeAssert.Char('a'),
                TreeAssert.Concat(
                    TreeAssert.Plus(
                        TreeAssert.Alt(
                            TreeAssert.Char('b'),
                            TreeAssert.Char('c'))),
                    TreeAssert.Char('d')));
        }