Update fmt_test.go

- add test with two-digits number index
This commit is contained in:
Vladimir Kuznetsov 2020-02-28 04:53:09 +00:00 committed by Arseny Balobanov
parent ec51581531
commit 6b51d2e906

View file

@ -44,6 +44,11 @@ func TestFormat(t *testing.T) {
args: []interface{}{0, 1, "World"}, args: []interface{}{0, 1, "World"},
result: "Hello, World", result: "Hello, World",
}, },
{
format: "{10}",
args: []interface{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
result: "10",
},
} { } {
t.Run(tc.result, func(t *testing.T) { t.Run(tc.result, func(t *testing.T) {
require.Equal(t, tc.result, Sprintf(tc.format, tc.args...)) require.Equal(t, tc.result, Sprintf(tc.format, tc.args...))