aboutsummaryrefslogtreecommitdiff
path: root/ops_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-04-08 00:48:01 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-04-08 00:48:01 +0200
commitff06b99475a8ec7f5673e5f6e6701919e98f8b21 (patch)
treecd597b1ad0878756a4601f135f56a86b88115478 /ops_test.go
parent677c9e83e301275b1390d8f1d92ac7145f2a1d10 (diff)
Add testing
Diffstat (limited to 'ops_test.go')
-rw-r--r--ops_test.go27
1 files changed, 27 insertions, 0 deletions
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")
+ }
+}