(t *testing.T)
| 1219 | } |
| 1220 | |
| 1221 | func TestPrinterPrintBinaryPlus(t *testing.T) { |
| 1222 | o := bytes.NewBufferString("") |
| 1223 | |
| 1224 | p := printer.NewPrinter(o) |
| 1225 | p.Print(&binary.Plus{ |
| 1226 | Left: &expr.Variable{ |
| 1227 | VarName: &node.Identifier{Value: "a"}, |
| 1228 | }, |
| 1229 | Right: &expr.Variable{ |
| 1230 | VarName: &node.Identifier{Value: "b"}, |
| 1231 | }, |
| 1232 | }) |
| 1233 | |
| 1234 | expected := `$a+$b` |
| 1235 | actual := o.String() |
| 1236 | |
| 1237 | if expected != actual { |
| 1238 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1239 | } |
| 1240 | } |
| 1241 | |
| 1242 | func TestPrinterPrintBinaryPow(t *testing.T) { |
| 1243 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…