From 509c5063d66e8bbef4ec1def1c99c318be51aceb Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 25 Aug 2016 03:13:39 +0200 Subject: Initial import --- go/bob/bob_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 go/bob/bob_test.go (limited to 'go/bob/bob_test.go') diff --git a/go/bob/bob_test.go b/go/bob/bob_test.go new file mode 100644 index 0000000..e53226d --- /dev/null +++ b/go/bob/bob_test.go @@ -0,0 +1,30 @@ +package bob + +import "testing" + +const targetTestVersion = 2 + +func TestHeyBob(t *testing.T) { + if testVersion != targetTestVersion { + t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion) + } + for _, tt := range testCases { + actual := Hey(tt.input) + if actual != tt.expected { + msg := ` + ALICE (%s): %q + BOB: %s + + Expected Bob to respond: %s` + t.Fatalf(msg, tt.description, tt.input, actual, tt.expected) + } + } +} + +func BenchmarkBob(b *testing.B) { + for _, tt := range testCases { + for i := 0; i < b.N; i++ { + Hey(tt.input) + } + } +} -- cgit v1.2.3