From bdedb84f7c2ddd5efb245208b8e6317fc893c123 Mon Sep 17 00:00:00 2001 From: z7zmey Date: Fri, 9 Feb 2018 12:46:16 +0200 Subject: [PATCH] InlinHtml tests --- node/stmt/t_inline_html_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 node/stmt/t_inline_html_test.go diff --git a/node/stmt/t_inline_html_test.go b/node/stmt/t_inline_html_test.go new file mode 100644 index 0000000..85a966e --- /dev/null +++ b/node/stmt/t_inline_html_test.go @@ -0,0 +1,29 @@ + +package stmt_test + +import ( + "bytes" + "testing" + + "github.com/z7zmey/php-parser/node" + "github.com/z7zmey/php-parser/node/stmt" + "github.com/z7zmey/php-parser/php5" + "github.com/z7zmey/php-parser/php7" +) + +func TestInlineHtml(t *testing.T) { + src := `
` + + expected := &stmt.StmtList{ + Stmts: []node.Node{ + &stmt.Nop{}, + &stmt.InlineHtml{Value: "
"}, + }, + } + + actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") + assertEqual(t, expected, actual) + + actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php") + assertEqual(t, expected, actual) +}