summaryrefslogtreecommitdiff
path: root/repeat_test.go
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-10-26 14:33:50 -0600
committermo khan <mo.khan@gmail.com>2019-10-26 14:33:50 -0600
commit984800d293f71553dce03bdd0482cab057e571fb (patch)
tree69843c0f4a800a89756f8db61ca8345b7f019472 /repeat_test.go
parentdcb726e7fabc7d68f69b697c2058404f74041a18 (diff)
gofmt -w *.go
Diffstat (limited to 'repeat_test.go')
-rw-r--r--repeat_test.go38
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
}