From 77da6b60ebe6671d86a5122d16f148704d3c83e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Wed, 16 Nov 2022 13:38:45 +0100 Subject: [PATCH] Fix variable closure issue in tests --- builder_test.go | 2 ++ cmd/xk6/main_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/builder_test.go b/builder_test.go index 56c182d..10e4e6b 100644 --- a/builder_test.go +++ b/builder_test.go @@ -48,6 +48,7 @@ func TestReplacementPath_Param(t *testing.T) { }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := tt.r.Param(); got != tt.want { @@ -80,6 +81,7 @@ func TestNewReplace(t *testing.T) { }, } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := NewReplace(tt.args.old, tt.args.new); !reflect.DeepEqual(got, tt.want) { diff --git a/cmd/xk6/main_test.go b/cmd/xk6/main_test.go index 2796d96..79851b3 100644 --- a/cmd/xk6/main_test.go +++ b/cmd/xk6/main_test.go @@ -126,6 +126,7 @@ func TestNormalizeImportPath(t *testing.T) { tests = append(tests, windowsTests...) } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() if got := normalizeImportPath(tt.args.currentModule, tt.args.cwd, tt.args.moduleDir); got != tt.want {