From 896fbe60c209c643ac02d6cb757793d81dac3488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 1 Apr 2019 19:58:01 +0100 Subject: [PATCH] consistently use %02d for subtest index names "test" as part of the name is redundant, and spaces aren't recommended. Add a padding for two digits, so that tests with more than a handful of subtests still print in a nice way. --- input_test.go | 8 ++++---- query_test.go | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/input_test.go b/input_test.go index 6d77980..233a093 100644 --- a/input_test.go +++ b/input_test.go @@ -84,7 +84,7 @@ func TestMouseClickNode(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -127,7 +127,7 @@ func TestMouseClickOffscreenNode(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -186,7 +186,7 @@ func TestKeyAction(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -236,7 +236,7 @@ func TestKeyActionNode(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() diff --git a/query_test.go b/query_test.go index 1636774..f5269dd 100644 --- a/query_test.go +++ b/query_test.go @@ -208,7 +208,7 @@ func TestClear(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -251,7 +251,7 @@ func TestReset(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -316,7 +316,7 @@ func TestSetValue(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -489,7 +489,7 @@ func TestSetAttributes(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -564,7 +564,7 @@ func TestSetAttributeValue(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -608,7 +608,7 @@ func TestRemoveAttribute(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -648,7 +648,7 @@ func TestClick(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -685,7 +685,7 @@ func TestDoubleClick(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -725,7 +725,7 @@ func TestSendKeys(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -808,7 +808,7 @@ func TestSubmit(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -845,7 +845,7 @@ func TestComputedStyle(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -896,7 +896,7 @@ func TestMatchedStyle(t *testing.T) { } for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { test := test t.Parallel() @@ -967,7 +967,7 @@ func TestFileUpload(t *testing.T) { // parent must finish for the children to run, made impossible by the // defers above. for i, test := range tests { - t.Run(fmt.Sprintf("test %d", i), func(t *testing.T) { + t.Run(fmt.Sprintf("%02d", i), func(t *testing.T) { ctx, cancel := testAllocate(t, "") defer cancel()