aoc-2022/utils/set_test.go

22 lines
434 B
Go
Raw Normal View History

2022-12-05 08:03:39 +00:00
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")
}
}