Update fmt_test.go

- rename variable and change format string
This commit is contained in:
Vladimir Kuznetsov 2020-03-01 04:18:10 +00:00 committed by Arseny Balobanov
parent 4dfb967b78
commit 87fe7a193a

View file

@ -9,10 +9,10 @@ import (
) )
func TestFormat(t *testing.T) { func TestFormat(t *testing.T) {
var interfaceSlice []interface{} = make([]interface{}, 1002) s := make([]interface{}, 1002)
interfaceSlice[10] = 1 s[10] = 1
interfaceSlice[100] = 1 s[100] = 1
interfaceSlice[1000] = 1 s[1000] = 1
for _, tc := range []struct { for _, tc := range []struct {
format string format string
@ -50,19 +50,19 @@ func TestFormat(t *testing.T) {
result: "Hello, World", result: "Hello, World",
}, },
{ {
format: "check {10}", format: "{10}",
args: interfaceSlice[:11], args: s[:11],
result: "check 1", result: "1",
}, },
{ {
format: "check {100}", format: "{100}",
args: interfaceSlice[:101], args: s[:101],
result: "check 1", result: "1",
}, },
{ {
format: "check {1000}", format: "{1000}",
args: interfaceSlice[:1001], args: s[:1001],
result: "check 1", result: "1",
}, },
} { } {
t.Run(tc.result, func(t *testing.T) { t.Run(tc.result, func(t *testing.T) {