summaryrefslogtreecommitdiff
path: root/repeat_test.go
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-10-22 20:04:24 -0600
committermo khan <mo.khan@gmail.com>2019-10-22 20:04:24 -0600
commit6e627fd115529c309504a7518bcea5dacddaa049 (patch)
tree8b48aae535ca5c00bcd3b8069411049eb2aa8ad6 /repeat_test.go
parent48dda879b3d64b223dee69f0c04376e80177393b (diff)
https://github.com/quii/learn-go-with-tests/blob/master/iteration.md
Diffstat (limited to 'repeat_test.go')
-rw-r--r--repeat_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/repeat_test.go b/repeat_test.go
new file mode 100644
index 0000000..37854a6
--- /dev/null
+++ b/repeat_test.go
@@ -0,0 +1,12 @@
+package main
+
+import "testing"
+
+func TestRepeat(t *testing.T) {
+ repeated := Repeat("a")
+ expected := "aaaaa"
+
+ if repeated != expected {
+ t.Errorf("expected %q but got %q", expected, repeated)
+ }
+}