diff options
| author | mo khan <mo.khan@gmail.com> | 2019-10-26 14:33:50 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2019-10-26 14:33:50 -0600 |
| commit | 984800d293f71553dce03bdd0482cab057e571fb (patch) | |
| tree | 69843c0f4a800a89756f8db61ca8345b7f019472 /repeat_test.go | |
| parent | dcb726e7fabc7d68f69b697c2058404f74041a18 (diff) | |
gofmt -w *.go
Diffstat (limited to 'repeat_test.go')
| -rw-r--r-- | repeat_test.go | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/repeat_test.go b/repeat_test.go index 6c179ce..a75d8ed 100644 --- a/repeat_test.go +++ b/repeat_test.go @@ -4,32 +4,32 @@ import "fmt" import "testing" func TestRepeat(t *testing.T) { - t.Run("default", func(t *testing.T) { - repeated := Repeat("a", 5) - expected := "aaaaa" + t.Run("default", func(t *testing.T) { + repeated := Repeat("a", 5) + expected := "aaaaa" - if repeated != expected { - t.Errorf("expected %q but got %q", expected, repeated) - } - }) + if repeated != expected { + t.Errorf("expected %q but got %q", expected, repeated) + } + }) - t.Run("custom interval", func(t *testing.T) { - repeated := Repeat("a", 10) - expected := "aaaaaaaaaa" + t.Run("custom interval", func(t *testing.T) { + repeated := Repeat("a", 10) + expected := "aaaaaaaaaa" - if repeated != expected { - t.Errorf("expected %q but got %q", expected, repeated) - } - }) + if repeated != expected { + t.Errorf("expected %q but got %q", expected, repeated) + } + }) } func BenchmarkRepeat(b *testing.B) { - for i := 0; i < b.N; i++ { - Repeat("a", 5) - } + for i := 0; i < b.N; i++ { + Repeat("a", 5) + } } func ExampleRepeat() { - fmt.Println(Repeat("x", 10)) - // Output: xxxxxxxxxx + fmt.Println(Repeat("x", 10)) + // Output: xxxxxxxxxx } |
