(t *testing.T)
| 27 | } |
| 28 | |
| 29 | func TestBinaryToDecimal(t *testing.T) { |
| 30 | for input, expected := range binaryTestCases { |
| 31 | out, err := BinaryToDecimal(input) |
| 32 | if err != nil { |
| 33 | t.Errorf("BinaryToDecimal(%s) returned an error %s", input, err.Error()) |
| 34 | } |
| 35 | if out != expected { |
| 36 | t.Errorf("BinaryToDecimal(%s) = %d; want %d", input, out, expected) |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func BenchmarkBinaryToDecimal(b *testing.B) { |
| 42 | b.ReportAllocs() |
nothing calls this directly
no test coverage detected