2
0
Эх сурвалжийг харах

net/tsaddr: include test input in test failure output

https://go.dev/wiki/CodeReviewComments#useful-test-failures

(Previously it was using subtests with names including the input, but
 once those went away, there was no context left)

Updates #14169

Change-Id: Ib217028183a3d001fe4aee58f2edb746b7b3aa88
Signed-off-by: Brad Fitzpatrick <[email protected]>
Brad Fitzpatrick 1 жил өмнө
parent
commit
0c8c7c0f90

+ 2 - 2
net/tsaddr/tsaddr_test.go

@@ -252,7 +252,7 @@ func TestIsTailscaleIPv4(t *testing.T) {
 	}
 	for _, tt := range tests {
 		if got := IsTailscaleIPv4(tt.in); got != tt.want {
-			t.Errorf("IsTailscaleIPv4() = %v, want %v", got, tt.want)
+			t.Errorf("IsTailscaleIPv4(%v) = %v, want %v", tt.in, got, tt.want)
 		}
 	}
 }
@@ -286,7 +286,7 @@ func TestIsTailscaleIP(t *testing.T) {
 	}
 	for _, tt := range tests {
 		if got := IsTailscaleIP(tt.in); got != tt.want {
-			t.Errorf("IsTailscaleIP() = %v, want %v", got, tt.want)
+			t.Errorf("IsTailscaleIP(%v) = %v, want %v", tt.in, got, tt.want)
 		}
 	}
 }