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.
This commit is contained in:
Daniel Martí 2019-04-01 19:58:01 +01:00
parent e482cdfc4d
commit 896fbe60c2
2 changed files with 17 additions and 17 deletions

View File

@ -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()

View File

@ -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()