From 1536d0d565f163000aba6265524dda290818a52b Mon Sep 17 00:00:00 2001 From: Levi Broderick Date: Tue, 15 May 2018 06:15:24 -0700 Subject: [PATCH] Add unit test to check edge case in Array.Reverse(Array, ...) (dotnet/corefx#29559) * Fix Array.Reverse tests to match validation checks in corelib * Revert "Fix Array.Reverse tests to match validation checks in corelib" Commit migrated from https://github.com/dotnet/corefx/commit/c75431cd74a92f97d7be15e754b15f76d9bce28c --- .../System.Runtime/tests/System/ArrayTests.netcoreapp.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libraries/System.Runtime/tests/System/ArrayTests.netcoreapp.cs b/src/libraries/System.Runtime/tests/System/ArrayTests.netcoreapp.cs index 6f2bbd7..853e09b 100644 --- a/src/libraries/System.Runtime/tests/System/ArrayTests.netcoreapp.cs +++ b/src/libraries/System.Runtime/tests/System/ArrayTests.netcoreapp.cs @@ -141,6 +141,16 @@ namespace System.Tests } [Fact] + public static void Reverse_NonSZArrayWithMinValueLowerBound() + { + Array array = NonZeroLowerBoundArray(new int[] { 1, 2, 3 }, int.MinValue); + + Reverse(array, int.MinValue, 0, new int[] { 1, 2, 3 }); + Reverse(array, int.MinValue, 1, new int[] { 1, 2, 3 }); + Reverse(array, int.MinValue, 2, new int[] { 2, 1, 3 }); + } + + [Fact] public void CreateInstance_TypeNotRuntimeType_ThrowsArgumentException() { // This cannot be a [Theory] due to https://github.com/xunit/xunit/issues/1325. -- 2.7.4