mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
泛型
This commit is contained in:
17
collections/generics/hashset_test.go
Normal file
17
collections/generics/hashset_test.go
Normal file
@ -0,0 +1,17 @@
|
||||
package generics_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/charlienet/go-mixed/collections/generics"
|
||||
)
|
||||
|
||||
func TestSet(t *testing.T) {
|
||||
|
||||
s := generics.NewHashSet[int]()
|
||||
s.Add(1, 2, 3)
|
||||
|
||||
expected := generics.NewHashSet(1, 2, 3)
|
||||
|
||||
_ = expected
|
||||
}
|
Reference in New Issue
Block a user