diff options
author | Marek Safar <marek.safar@gmail.com> | 2017-03-23 16:12:13 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-03-28 00:36:35 +0300 |
commit | a2ec6eb28ec1e1cd020c36b5d51b4afa5cf267dd (patch) | |
tree | 5e17babe107083484b1c52da3c76819fb257c5b5 /mcs/class/corlib | |
parent | 778388f9eea26c0398810aa7cd9539651f94101a (diff) |
[corlib] Add more Array tests
Diffstat (limited to 'mcs/class/corlib')
-rw-r--r-- | mcs/class/corlib/Test/System/ArrayTest.cs | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ -2583,6 +2583,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() { bool catched=false; |