Skip to content

Commit

Permalink
Add test cases for Slice/Range operator
Browse files Browse the repository at this point in the history
  • Loading branch information
andreise committed Mar 13, 2024
1 parent 6f6691d commit d99be4e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ public static TheoryData<FlatArray<int>, Range> SliceOperator_OutOfRange_ExpectA
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
..3);

result.Add(
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
2..0);

result.Add(
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
2..1);

result.Add(
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
2..3);

result.Add(
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
2..4);

result.Add(
new[] { MinusFifteen, PlusFifteen, MinusOne, One }.InitializeFlatArray(3),
1..4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ public void SliceOperator_SourceNotEmpty_InRange_ExpectCorrectResult(
..2,
[MinusFifteen, PlusFifteen]);

result.Add(
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
2..2,
null);

result.Add(
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
2..,
null);

result.Add(
new[] { MinusFifteen, PlusFifteen }.InitializeFlatArray(),
..,
Expand Down

0 comments on commit d99be4e

Please sign in to comment.