package main import "testing" func TestAdd(t *testing.T) { if _, ok := verify("+"); !ok { t.Error("add failed") } } func BenchmarkAdd(b *testing.B) { for i := 0; i < b.N; i++ { verify("+") } } func TestSub(t *testing.T) { if _, ok := verify("-"); !ok { t.Error("sub failed") } } func BenchmarkSub(b *testing.B) { for i := 0; i < b.N; i++ { verify("-") } } func TestMul(t *testing.T) { if _, ok := verify("*"); !ok { t.Error("mul failed") } } func BenchmarkMul(b *testing.B) { for i := 0; i < b.N; i++ { verify("*") } } func TestPot(t *testing.T) { if _, ok := verify("^"); !ok { t.Error("pot failed") } } func BenchmarkPot(b *testing.B) { for i := 0; i < b.N; i++ { verify("^") } }