From ed0f6d06457fc2f660268a87f1b60c62a4700aef Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Mon, 20 Nov 2023 22:59:39 +0000 Subject: [PATCH] use and unsorted list --- test/algorithms_test.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/algorithms_test.dart b/test/algorithms_test.dart index ab220d8..4bc1d54 100644 --- a/test/algorithms_test.dart +++ b/test/algorithms_test.dart @@ -373,8 +373,12 @@ void main() { () { // Regression test for https://github.com/dart-lang/collection/issues/317 final length = 1000; // Larger than _mergeSortLimit - // In order list, first half empties first during merge. - final list = List.generate(length, (i) => i); + // Out of order list, with first half guaranteed to empty first during + // merge. + final list = [ + for (var i = 0; i < length / 2; i++) -i, + for (var i = 0; i < length / 2; i++) i + length, + ]; expect(() => mergeSort(list), returnsNormally); }); }