Skip to content

Commit a9b7fb0

Browse files
committed
Add back the entropy following dmd bug fix
1 parent d5e2b60 commit a9b7fb0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

std/algorithm/sorting.d

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,6 +2813,10 @@ schwartzSort(alias transform, alias less = "a < b",
28132813
arr[2] = highEnt;
28142814

28152815
schwartzSort!(entropy, q{a > b})(arr);
2816+
2817+
assert(arr[0] == highEnt);
2818+
assert(arr[1] == midEnt);
2819+
assert(arr[2] == lowEnt);
28162820
assert(isSorted!("a > b")(map!(entropy)(arr)));
28172821
}
28182822

@@ -2843,6 +2847,10 @@ schwartzSort(alias transform, alias less = "a < b",
28432847
arr[2] = highEnt;
28442848

28452849
schwartzSort!(entropy, q{a < b})(arr);
2850+
2851+
assert(arr[0] == lowEnt);
2852+
assert(arr[1] == midEnt);
2853+
assert(arr[2] == highEnt);
28462854
assert(isSorted!("a < b")(map!(entropy)(arr)));
28472855
}
28482856

0 commit comments

Comments
 (0)