Fix tests.

pull/1205/head
dlorenc 2017-03-07 10:18:44 -08:00 committed by Dale Hamel
parent 107e3324a6
commit c220ada63b
1 changed files with 3 additions and 2 deletions

View File

@ -61,6 +61,7 @@ type subConfig3 struct {
}
func buildConfig() testConfig {
_, cidr, _ := net.ParseCIDR("12.34.56.78/16")
return testConfig{
A: "foo",
B: 1,
@ -76,7 +77,7 @@ func buildConfig() testConfig {
P: false,
Q: net.ParseIP("12.34.56.78"),
R: utilnet.PortRange{Base: 2, Size: 4},
T: net.ParseCIDR("12.34.0.0/16")[1],
T: *cidr,
},
},
E: &subConfig2{
@ -178,7 +179,7 @@ func TestSetElement(t *testing.T) {
{"D.I.R", "7-11", func(t testConfig) bool { return t.D.I.R.Base == 7 && t.D.I.R.Size == 5 }},
{"D.I.S", "a,b", func(t testConfig) bool { return reflect.DeepEqual(t.D.I.S, []string{"a", "b"}) }},
{"D.I.T", "foo", func(t testConfig) bool { return t.D.I.T == "foo" }},
{"D.I.U", "11.22.0.0/16", func(t testConfig) bool { return t.D.I.U.Network.Equal(net.ParseCIDR("11.22.0.0/16").Network) }},
{"D.I.U", "11.22.0.0/16", func(t testConfig) bool { return t.D.I.U.String() == "11.22.0.0/16" }},
} {
a := buildConfig()
if err := FindAndSet(tc.path, &a, tc.newval); err != nil {