From ff06b99475a8ec7f5673e5f6e6701919e98f8b21 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 8 Apr 2015 00:48:01 +0200 Subject: Add testing --- ops_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ops_test.go (limited to 'ops_test.go') diff --git a/ops_test.go b/ops_test.go new file mode 100644 index 0000000..cd907b3 --- /dev/null +++ b/ops_test.go @@ -0,0 +1,27 @@ +package main + +import "testing" + +func TestAdd(t *testing.T) { + if !verify("+", add) { + t.Error("add failed") + } +} + +func TestSub(t *testing.T) { + if !verify("-", sub) { + t.Error("sub failed") + } +} + +func TestTimes(t *testing.T) { + if !verify("*", times) { + t.Error("times failed") + } +} + +func TestPot(t *testing.T) { + if !verify("^", pot) { + t.Error("pot failed") + } +} -- cgit v1.2.3