Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1445591

Browse files
committed
Add coverage for Enumerable.Range
Covers the case where we enumerate up to Int32.MaxValue
1 parent b75ffa4 commit 1445591

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/System.Linq/tests/RangeTests.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,18 @@ public void Range_GetEnumeratorReturnUniqueInstances()
9292
Assert.NotSame(enum1, enum2);
9393
}
9494
}
95+
96+
[Fact]
97+
public void Range_ToInt32MaxValue()
98+
{
99+
int from = Int32.MaxValue - 3;
100+
int count = 4;
101+
var rangeEnumerable = Enumerable.Range(from, count);
102+
103+
Assert.Equal(count, rangeEnumerable.Count());
104+
105+
int[] expected = { Int32.MaxValue - 3, Int32.MaxValue - 2, Int32.MaxValue - 1, Int32.MaxValue };
106+
Assert.Equal(expected, rangeEnumerable);
107+
}
95108
}
96109
}

0 commit comments

Comments
 (0)