func TestMergeIncomplete(t *testing.T) {
	c := EmptyMasqConfig()

	c1 := &MasqConfig{
		NonMasqueradeCIDRs: []string{"10.128.0.192/26", "100.16.0.0/12"},
	}

	c.merge(c1)

	want := &MasqConfig{
		NonMasqueradeCIDRs: []string{"10.128.0.192/26", "100.16.0.0/12"},
		MasqLinkLocal:      false,
		MasqLinkLocalIPv6:  false,
	}

	c.merge(c1)
	if !c.equals(want) {
		t.Errorf("c.merge(c1) [missing fields] wrote %v, want %v", c, want)
	}

	c2 := &MasqConfig{
		MasqLinkLocal: true,
	}

	want = &MasqConfig{
		NonMasqueradeCIDRs: []string{"10.128.0.192/26", "100.16.0.0/12"},
		MasqLinkLocal:      true,
		MasqLinkLocalIPv6:  false,
	}

	c.merge(c2)
	if !c.equals(want) {
		t.Errorf("c.merge(c2) [missing fields] wrote %v, want %v", c, want)
	}
}
// tests merge handling missing fields
tests merge handling missing fields
// tests merge handling missing fields
func TestMergeIncomplete(t *testing.T) {
	c := EmptyMasqConfig()
	c1 := &MasqConfig{
		NonMasqueradeCIDRs: []string{"10.128.0.192/26", "100.16.0.0/12"},
	}
	c.merge(c1)
	want := &MasqConfig{
		NonMasqueradeCIDRs: []string{"10.128.0.192/26", "100.16.0.0/12"},
		MasqLinkLocal:      false,
		MasqLinkLocalIPv6:  false,
	}
	c.merge(c1)
	if !c.equals(want) {
		t.Errorf("c.merge(c1) [missing fields] wrote %v, want %v", c, want)
	}
	c2 := &MasqConfig{
		MasqLinkLocal: true,
	}
	want = &MasqConfig{
		NonMasqueradeCIDRs: []string{"10.128.0.192/26", "100.16.0.0/12"},
		MasqLinkLocal:      true,
		MasqLinkLocalIPv6:  false,
	}
	c.merge(c2)
	if !c.equals(want) {
		t.Errorf("c.merge(c2) [missing fields] wrote %v, want %v", c, want)
	}
}
func TestMergeIncomplete ( t * testing . T ) { c := EmptyMasqConfig ( ) c1 := & MasqConfig { NonMasqueradeCIDRs : [ ] string { " " , " " } , } c . merge ( c1 ) want := & MasqConfig { NonMasqueradeCIDRs : [ ] string { " " , " " } , MasqLinkLocal : false , MasqLinkLocalIPv6 : false , } c . merge ( c1 ) if ! c . equals ( want ) { t . Errorf ( " " , c , want ) } c2 := & MasqConfig { MasqLinkLocal : true , } want = & MasqConfig { NonMasqueradeCIDRs : [ ] string { " " , " " } , MasqLinkLocal : true , MasqLinkLocalIPv6 : false , } c . merge ( c2 ) if ! c . equals ( want ) { t . Errorf ( " " , c , want ) } }
tests merge handling missing fields
tests merge handling missing fields