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'))); }
public void Parse_WithGroupedAlternativesInConcatination_ReturnsExpectedTree() { // Arrange var pattern = "a(b|c)d"; // Act var regex = Regex.Parse(pattern); // Assert regex.Tree.AssertConcatenation( TreeAssert.Char('a'), TreeAssert.Concat( TreeAssert.Alt( TreeAssert.Char('b'), TreeAssert.Char('c')), TreeAssert.Char('d'))); }
public void Parse_WithConcatinatedAlternatives_ReturnsExpectedTree() { // Arrange var pattern = "ab|cd"; // Act var regex = Regex.Parse(pattern); // Assert regex.Tree.AssertAlternative( TreeAssert.Concat( TreeAssert.Char('a'), TreeAssert.Char('b')), TreeAssert.Concat( TreeAssert.Char('c'), TreeAssert.Char('d'))); }
public void Parse_WithMultipleChars_ReturnsExpectedTree() { // Arrange var pattern = "abcde"; // Act var regex = Regex.Parse(pattern); // Assert regex.Tree.AssertConcatenation( TreeAssert.Char('a'), TreeAssert.Concat( TreeAssert.Char('b'), TreeAssert.Concat( TreeAssert.Char('c'), TreeAssert.Concat( TreeAssert.Char('d'), TreeAssert.Char('e'))))); }