1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-03-01 00:35:28 +08:00

Merge pull request #293 from YoghurtFree/fix_slice_test

fix(slice_test) , should not assume the order of the slice
This commit is contained in:
残念
2025-02-09 23:10:28 +08:00
committed by GitHub

View File

@@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"math" "math"
"reflect" "reflect"
"sort"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
@@ -1794,6 +1795,8 @@ func TestFilterConcurrent(t *testing.T) {
nums := []int{1, 2, 3, 4, 5, 6} nums := []int{1, 2, 3, 4, 5, 6}
expected := []int{4, 5, 6} expected := []int{4, 5, 6}
actual := FilterConcurrent(nums, func(_, n int) bool { return n > 3 }, 4) actual := FilterConcurrent(nums, func(_, n int) bool { return n > 3 }, 4)
sort.Ints(actual)
sort.Ints(expected)
assert.Equal(expected, actual) assert.Equal(expected, actual)
}) })
} }