diff options
Diffstat (limited to 'go/raindrops/raindrops_test.go')
-rw-r--r-- | go/raindrops/raindrops_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/go/raindrops/raindrops_test.go b/go/raindrops/raindrops_test.go new file mode 100644 index 0000000..14f0983 --- /dev/null +++ b/go/raindrops/raindrops_test.go @@ -0,0 +1,20 @@ +package raindrops + +import "testing" + +func TestConvert(t *testing.T) { + for _, test := range tests { + if actual := Convert(test.input); actual != test.expected { + t.Errorf("Convert(%d) = %q, expected %q.", + test.input, actual, test.expected) + } + } +} + +func BenchmarkConvert(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, test := range tests { + Convert(test.input) + } + } +} |