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 <bradfitz@tailscale.com>
pull/14181/head
Brad Fitzpatrick 5 days ago committed by Brad Fitzpatrick
parent af4c3a4a1b
commit 0c8c7c0f90

@ -252,7 +252,7 @@ func TestIsTailscaleIPv4(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
if got := IsTailscaleIPv4(tt.in); got != tt.want { 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 { for _, tt := range tests {
if got := IsTailscaleIP(tt.in); got != tt.want { 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)
} }
} }
} }

Loading…
Cancel
Save