diff --git a/Algorithms.Tests/Sorters/Comparison/TimSorterTests.cs b/Algorithms.Tests/Sorters/Comparison/TimSorterTests.cs index 822ac789..9b5f2b9b 100755 --- a/Algorithms.Tests/Sorters/Comparison/TimSorterTests.cs +++ b/Algorithms.Tests/Sorters/Comparison/TimSorterTests.cs @@ -66,4 +66,20 @@ public static void SmallChunks() // Assert Assert.That(correctArray, Is.EqualTo(testArray)); } + + [Test] + public static void SkipsEntireLeftRun() + { + // Arrange + var sorter = new TimSorter(Settings, IntComparer); + var testArray = new[] { 0, 1, 2, 3, 4, 5, 100, 101, 102, 103, 104, 105 }; + var correctArray = (int[])testArray.Clone(); + + // Act + sorter.Sort(testArray, IntComparer); + Array.Sort(correctArray, IntComparer); + + // Assert + Assert.That(testArray, Is.EqualTo(correctArray)); + } }