示例#1
0
        public void SpanShouldStartAfterChildNodes()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new QuantifierStarNode(childNode);

            // Act
            var(Start, Length) = target.GetSpan();

            // Assert
            Start.ShouldBe(childNode.ToString().Length);
            Length.ShouldBe(1);
        }
示例#2
0
        public void QuantifierShouldStartBeforeLazyToken()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new QuantifierStarNode(childNode);

            _ = new LazyNode(target);

            // Act
            var(Start, Length) = target.GetSpan();

            // Assert
            Start.ShouldBe(1);
            Length.ShouldBe(1);
        }
示例#3
0
        public void SpanShouldStartAfterPrefix()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var prefix    = new CommentGroupNode("X");
            var target    = new QuantifierStarNode(childNode)
            {
                Prefix = prefix
            };

            // Act
            var(Start, Length) = target.GetSpan();

            // Assert
            Start.ShouldBe(6);
            Length.ShouldBe(1);
        }
示例#4
0
        public void QuantifierShouldStartBeforeLazyTokensPrefix()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new QuantifierStarNode(childNode);
            var prefix    = new CommentGroupNode("X");

            _ = new LazyNode(target)
            {
                Prefix = prefix
            };

            // Act
            var(Start, Length) = target.GetSpan();

            // Assert
            Start.ShouldBe(1);
            Length.ShouldBe(1);
        }