(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestPrintFileInlineHtml(t *testing.T) { |
| 87 | o := bytes.NewBufferString("") |
| 88 | |
| 89 | p := printer.NewPrettyPrinter(o, " ") |
| 90 | p.Print(&node.Root{ |
| 91 | Stmts: []node.Node{ |
| 92 | &stmt.InlineHtml{Value: "<div>HTML</div>"}, |
| 93 | &stmt.Expression{ |
| 94 | Expr: &scalar.Heredoc{ |
| 95 | Label: "<<<\"LBL\"\n", |
| 96 | Parts: []node.Node{ |
| 97 | &scalar.EncapsedStringPart{Value: "hello world\n"}, |
| 98 | }, |
| 99 | }, |
| 100 | }, |
| 101 | }, |
| 102 | }) |
| 103 | |
| 104 | expected := `<div>HTML</div><?php |
| 105 | <<<"LBL" |
| 106 | hello world |
| 107 | LBL; |
| 108 | ` |
| 109 | actual := o.String() |
| 110 | |
| 111 | if expected != actual { |
| 112 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // node |
| 117 |
nothing calls this directly
no test coverage detected
searching dependent graphs…