func TestMkTargetInfo(t *testing.T) {
	r := &Reporter{
		sysVars: map[string]string{
			"hostname":  "host1",
			"public_ip": "1.1.1.1",
		},
		reportVars: []string{"public_ip"},
		groups:     []string{"Group 1"},
	}
	pb := r.mkTargetInfo()
	if pb.GetInstanceName() != "host1" {
		t.Errorf("pb.GetInstanceName() = %q, want \"host1\".", pb.GetInstanceName())
	}
	if diff := pretty.Compare([]string{"Group 1"}, pb.GetGroups()); diff != "" {
		t.Errorf("pb.GetGroups() got diff:\n%s", diff)
	}
	addrs := pb.GetAddresses()
	if len(addrs) != 1 {
		t.Fatalf("len(addrs) = %v, want 1.", len(addrs))
	}
	if addrs[0].GetTag() != "public_ip" {
		t.Errorf("a.GetTag() = %q, want \"public_ip\".", addrs[0].GetTag())
	}
	if addrs[0].GetAddress() != "1.1.1.1" {
		t.Errorf("a.GetAddress() = %q, want \"1.1.1.1\".", addrs[0].GetAddress())
	}
}
// TestMkTargetInfo tests the basic functionality of mkTargetInfo for regression
// purposes.
TestMkTargetInfo tests the basic functionality of mkTargetInfo for regression
purposes.
// TestMkTargetInfo tests the basic functionality of mkTargetInfo for regression // purposes .
func TestMkTargetInfo(t *testing.T) {
	r := &Reporter{
		sysVars: map[string]string{
			"hostname":  "host1",
			"public_ip": "1.1.1.1",
		},
		reportVars: []string{"public_ip"},
		groups:     []string{"Group 1"},
	}
	pb := r.mkTargetInfo()
	if pb.GetInstanceName() != "host1" {
		t.Errorf("pb.GetInstanceName() = %q, want \"host1\".", pb.GetInstanceName())
	}
	if diff := pretty.Compare([]string{"Group 1"}, pb.GetGroups()); diff != "" {
		t.Errorf("pb.GetGroups() got diff:\n%s", diff)
	}
	addrs := pb.GetAddresses()
	if len(addrs) != 1 {
		t.Fatalf("len(addrs) = %v, want 1.", len(addrs))
	}
	if addrs[0].GetTag() != "public_ip" {
		t.Errorf("a.GetTag() = %q, want \"public_ip\".", addrs[0].GetTag())
	}
	if addrs[0].GetAddress() != "1.1.1.1" {
		t.Errorf("a.GetAddress() = %q, want \"1.1.1.1\".", addrs[0].GetAddress())
	}
}
func TestMkTargetInfo ( t * testing . T ) { r := & Reporter { sysVars : map [ string ] string { " " : " " , " " : " " , } , reportVars : [ ] string { " " } , groups : [ ] string { " " } , } pb := r . mkTargetInfo ( ) if pb . GetInstanceName ( ) != " " { t . Errorf ( " \" \" " , pb . GetInstanceName ( ) ) } if diff := pretty . Compare ( [ ] string { " " } , pb . GetGroups ( ) ) ; diff != " " { t . Errorf ( " \n " , diff ) } addrs := pb . GetAddresses ( ) if len ( addrs ) != 1 { t . Fatalf ( " " , len ( addrs ) ) } if addrs [ 0 ] . GetTag ( ) != " " { t . Errorf ( " \" \" " , addrs [ 0 ] . GetTag ( ) ) } if addrs [ 0 ] . GetAddress ( ) != " " { t . Errorf ( " \" \" " , addrs [ 0 ] . GetAddress ( ) ) } }
TestMkTargetInfo tests the basic functionality of mkTargetInfo for regression
purposes.
TestMkTargetInfo tests the basic functionality of mkTargetInfo for regression purposes .