[#82] add support of shebang

This commit is contained in:
z7zmey
2019-12-30 00:20:20 +02:00
parent 4a518d9e5d
commit 31052588b1
5 changed files with 8968 additions and 8770 deletions

View File

@@ -1077,6 +1077,18 @@ func TestParseAndPrintPhp5InlineHtml(t *testing.T) {
}
}
func TestParseAndPrintPhp5Shebang(t *testing.T) {
src := `#!/usr/bin/env php
<?php
$a;?>test<? `
actual := print(parse(src))
if src != actual {
t.Errorf("\nexpected: %s\ngot: %s\n", src, actual)
}
}
func TestParseAndPrintPhp5Interface(t *testing.T) {
src := `<?php
interface Foo extends Bar , Baz {

View File

@@ -1200,6 +1200,18 @@ func TestParseAndPrintInlineHtml(t *testing.T) {
}
}
func TestParseAndPrintShebang(t *testing.T) {
src := `#!/usr/bin/env php
<?php
$a;?>test<? `
actual := print(parse(src))
if src != actual {
t.Errorf("\nexpected: %s\ngot: %s\n", src, actual)
}
}
func TestParseAndPrintInterface(t *testing.T) {
src := `<?php
interface Foo extends Bar , Baz {