mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-23 13:52:26 +08:00
fix: fix TestMapToSlice function result independent of order of elements
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/duke-git/lancet/v2/internal"
|
"github.com/duke-git/lancet/v2/internal"
|
||||||
|
"github.com/duke-git/lancet/v2/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestToChar(t *testing.T) {
|
func TestToChar(t *testing.T) {
|
||||||
@@ -204,7 +205,10 @@ func TestMapToSlice(t *testing.T) {
|
|||||||
return key + ":" + strconv.Itoa(value)
|
return key + ":" + strconv.Itoa(value)
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.Equal([]string{"a:1", "b:2", "c:3"}, result)
|
assert.Equal(3, len(result))
|
||||||
|
assert.Equal(true, slice.Contain(result, "a:1"))
|
||||||
|
assert.Equal(true, slice.Contain(result, "b:2"))
|
||||||
|
assert.Equal(true, slice.Contain(result, "c:3"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestColorHexToRGB(t *testing.T) {
|
func TestColorHexToRGB(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user