From a2ec6eb28ec1e1cd020c36b5d51b4afa5cf267dd Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 23 Mar 2017 14:12:13 +0100 Subject: [PATCH] [corlib] Add more Array tests --- mcs/class/corlib/Test/System/ArrayTest.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs index 443b6874e6a..53df7555fdb 100644 --- a/mcs/class/corlib/Test/System/ArrayTest.cs +++ b/mcs/class/corlib/Test/System/ArrayTest.cs @@ -2582,6 +2582,26 @@ public class ArrayTest } } + [Test] + public void TestSortComparableMixed() + { + var m = new TestSortComparableMixed_Comparer (); + var arr = new object [] { 1, 2, m, 4, 5, 6, 7, 8, 9, 10 }; + + Array.Sort (arr); + + var expected = new object [] { m, 1, 2, 4, 5, 6, 7, 8, 9, 10 }; + Assert.AreEqual (expected, arr); + } + + class TestSortComparableMixed_Comparer : IComparable + { + public int CompareTo (object other) + { + return -1; + } + } + [Test] public void TestInitializeEmpty() { -- 2.25.1