| 1500 | } |
| 1501 | |
| 1502 | func TestParseAndPrintComplexString2(t *testing.T) { |
| 1503 | src := `<?php |
| 1504 | "test ${ foo }" ; |
| 1505 | "test ${ foo . 'bar' }" ; |
| 1506 | "test ${ foo [ ] }" ; |
| 1507 | "test ${ foo [ $b ] }" ; |
| 1508 | "test ${ foo [ 1 ] }" ; |
| 1509 | "test ${ foo [ 'expr' . $bar ] }" ; |
| 1510 | "test ${ $foo }" ; |
| 1511 | "test ${ $foo -> bar }" ; |
| 1512 | "test ${ $foo -> bar ( ) }" ; |
| 1513 | "test ${ $a . '' }" ; |
| 1514 | ` |
| 1515 | |
| 1516 | actual := print(parse(src)) |
| 1517 | |
| 1518 | if src != actual { |
| 1519 | t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) |
| 1520 | } |
| 1521 | } |
| 1522 | |
| 1523 | func TestParseAndPrintComplexString3(t *testing.T) { |
| 1524 | src := `<?php |