22 lines
434 B
Go
22 lines
434 B
Go
|
|
package utils
|
||
|
|
|
||
|
|
import (
|
||
|
|
"reflect"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestSetItems(t *testing.T) {
|
||
|
|
s := NewSet(1, 2, 3, 2, 2, 1)
|
||
|
|
|
||
|
|
if !reflect.DeepEqual(s.Items(), []int{1, 2, 3}) {
|
||
|
|
t.Error("new set does not contain initial items")
|
||
|
|
}
|
||
|
|
|
||
|
|
items := []string{"hello", "there", "world", "sta", "satasr", "aaaaa", "tawfptars"}
|
||
|
|
s1 := NewSet(items...)
|
||
|
|
|
||
|
|
if !reflect.DeepEqual(s1.Items(), items) {
|
||
|
|
t.Error("new set does not contain initial items")
|
||
|
|
}
|
||
|
|
}
|