Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for new issue
  • Loading branch information
hrrrrustic committed Jul 12, 2021
commit 0cb330eab5d2e0d0c272ebde9156f5260c1a17eb
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,17 @@ public void IndexOfAny_SearchOnlyInsideTheRange_IfStartAndCountAreProvided()
Assert.Equal(-1, result);
}

[Fact]
public void IndexOfAny_StartOverflowsWithOffset_OutOfRangeThrows()
{
// Arrange
StringSegment segment = new StringSegment("12345", 0, 1);

// Act & Assert
ArgumentOutOfRangeException exception = Assert.Throws<ArgumentOutOfRangeException>(() => segment.IndexOfAny(new []{ '5' }, 2, 3));
Assert.Equal("start", exception.ParamName);
}

[Fact]
public void LastIndexOf_ComputesIndex_RelativeToTheCurrentSegment()
{
Expand Down