some tests
This commit is contained in:
19
set_test.go
Normal file
19
set_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package extypes
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSet(t *testing.T) {
|
||||
s1 := make(Set[int], 0)
|
||||
s2 := make(Set[int], 0)
|
||||
|
||||
s1 = s1.Add(1)
|
||||
s1 = s1.Add(2)
|
||||
s1 = s1.Add(2)
|
||||
|
||||
s2 = s2.Add(1)
|
||||
s2 = s2.Add(2)
|
||||
|
||||
if !s1.Equal(s2) {
|
||||
t.Error("s1 and s2 not equal")
|
||||
}
|
||||
}
|
||||
12
tuple_test.go
Normal file
12
tuple_test.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package extypes
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestTuple(t *testing.T) {
|
||||
t1 := NewTupleFrom([]int{1, 2, 3})
|
||||
t2 := NewTupleFrom([]int{1, 2, 3})
|
||||
|
||||
if !t1.Equal(t2) {
|
||||
t.Error("t1 and t2 should be equal")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user