mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(package): [algorithm] keep duplicate CountSort entries (#387)
This commit is contained in:
1 parent
3811d3db8e
commit
cb45ef2d36
2 files changed
+5
-1
No files matched your search
@@ -199,6 +199,9 @@ func TestMergeSort(t *testing.T) {
|
||||
func TestCountSort(t *testing.T) {
|
||||
t.Parallel()
|
||||
assert := internal.NewAssert(t, "TestCountSort")
|
||||
assert.Equal([]int{1, 2, 2}, CountSort([]int{2, 1, 2}, &intComparator{}))
|
||||
assert.Equal([]people{{"young", 10}, {"first", 20}, {"second", 20}},
|
||||
CountSort([]people{{"first", 20}, {"young", 10}, {"second", 20}}, &peopleAgeComparator{}))
|
||||
|
||||
peoples := []people{
|
||||
{Name: "a", Age: 20},
|
||||
|
||||
Reference in new issue
Block a user