php5 test coverage

This commit is contained in:
z7zmey
2018-02-14 12:30:41 +02:00
parent 4cac863d8f
commit 6d714725bd
4 changed files with 1484 additions and 1411 deletions

View File

@@ -104,6 +104,26 @@ func TestMultilineSingleQuotedScalarString(t *testing.T) {
assertEqual(t, expected, actual)
}
func TestPlainHeredocEmptyString(t *testing.T) {
src := `<? <<<CAD
CAD;
`
expected := &stmt.StmtList{
Stmts: []node.Node{
&stmt.Expression{
Expr: &scalar.Encapsed{},
},
},
}
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual)
actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual)
}
func TestPlainHeredocScalarString(t *testing.T) {
src := `<? <<<CAD
hello