diff options
| author | mo khan <mo.khan@gmail.com> | 2019-10-22 20:11:39 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2019-10-22 20:11:39 -0600 |
| commit | 55b4c85011aa17373000dbc5a64ec7bf48ccc4aa (patch) | |
| tree | 14f09c4583bc47cf4444729ec299f2f4e352119a /repeat_test.go | |
| parent | 5c49c8451057855b4ff7f75fa716c2953b1c3e2f (diff) | |
start test to specify times
Diffstat (limited to 'repeat_test.go')
| -rw-r--r-- | repeat_test.go | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/repeat_test.go b/repeat_test.go index 3ac6266..4cfe358 100644 --- a/repeat_test.go +++ b/repeat_test.go @@ -3,12 +3,23 @@ package main import "testing" func TestRepeat(t *testing.T) { - repeated := Repeat("a") - expected := "aaaaa" + t.Run("default", func(t *testing.T) { + repeated := Repeat("a") + 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" + + if repeated != expected { + t.Errorf("expected %q but got %q", expected, repeated) + } + }) } func BenchmarkRepeat(b *testing.B) { |
