[#82] add support of shebang
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user