Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Algorithms.Tests/Sorters/Comparison/TimSorterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(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));
}
}