From 0c8c7c0f901f8a5e6cefe1334f3d2e0ad4db7b69 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 20 Nov 2024 16:14:13 -0800 Subject: [PATCH] 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 --- net/tsaddr/tsaddr_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/tsaddr/tsaddr_test.go b/net/tsaddr/tsaddr_test.go index 43977352b..9ac1ce303 100644 --- a/net/tsaddr/tsaddr_test.go +++ b/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) } } }