Fixed GetLanguagesByShebang for paths with “env”

This commit is contained in:
Michael Rykov
2021-06-19 00:35:49 +08:00
parent 335b4a64d8
commit 58f8dccbcf
2 changed files with 13 additions and 7 deletions

View File

@ -296,7 +296,8 @@ println("The shell script says ",vm.arglist.concat(" "));`
{name: "TestGetLanguagesByShebang_8", content: []byte(`#!bash`), expected: []string{"Shell"}},
{name: "TestGetLanguagesByShebang_9", content: []byte(multilineExecHack), expected: []string{"Tcl"}},
{name: "TestGetLanguagesByShebang_10", content: []byte(multilineNoExecHack), expected: []string{"Shell"}},
{name: "TestGetLanguagesByShebang_11", content: []byte(`#!`), expected: nil},
{name: "TestGetLanguagesByShebang_11", content: []byte(`#!/envinpath/python`), expected: []string{"Python"}},
{name: "TestGetLanguagesByShebang_12", content: []byte(`#!`), expected: nil},
}
for _, test := range tests {