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