You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
795 B
Go

// Package util -----------------------------
// @file : list_test.go
// @author : JJXu
// @contact : wavingbear@163.com
// @time : 2023/6/1 16:48
// -------------------------------------------
package util
import (
"reflect"
"testing"
)
func Test_uniqueBaseTypeList(t *testing.T) {
type args[T comparable] struct {
list []T
}
type testCase[T comparable] struct {
name string
args args[T]
want []T
}
tests := []testCase[int]{
{
name: "test1",
args: args[int]{list: []int{1, 1, 2, 3, 4, 2}},
want: []int{1, 2, 3, 4},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := UniqueBaseTypeList(tt.args.list); !reflect.DeepEqual(got, tt.want) {
t.Errorf("uniqueBaseTypeList() = %v, want %v", got, tt.want)
}
})
}
}