// 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) } }) } }