assign
(t *testing.T)
| 482 | // assign |
| 483 | |
| 484 | func TestPrinterPrintAssign(t *testing.T) { |
| 485 | o := bytes.NewBufferString("") |
| 486 | |
| 487 | p := printer.NewPrinter(o) |
| 488 | p.Print(&assign.Assign{ |
| 489 | Variable: &expr.Variable{ |
| 490 | VarName: &node.Identifier{Value: "a"}, |
| 491 | }, |
| 492 | Expression: &expr.Variable{ |
| 493 | VarName: &node.Identifier{Value: "b"}, |
| 494 | }, |
| 495 | }) |
| 496 | |
| 497 | expected := `$a=$b` |
| 498 | actual := o.String() |
| 499 | |
| 500 | if expected != actual { |
| 501 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | func TestPrinterPrintReference(t *testing.T) { |
| 506 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…