1 package relayinfo 2 3 import "testing" 4 5 func TestAddSupportedNIP(t *testing.T) { 6 info := NewInfo(nil) 7 info.AddNIPs(12, 12, 13, 1, 12, 44, 2, 13, 2, 13, 0, 17, 19, 1, 18) 8 for i, v := range []int{0, 1, 2, 12, 13, 17, 18, 19, 44} { 9 if !info.HasNIP(v) { 10 t.Errorf("expected info.nips[%d] to equal %v, got %v", 11 i, v, info.Nips) 12 return 13 } 14 } 15 } 16