chore: fix a wasm bash test

This commit is contained in:
Andrew Hlynskyi 2023-08-25 16:55:08 +03:00
parent 39bbd9867d
commit b22e4fe3c9

View file

@ -127,19 +127,19 @@ describe("Parser", () => {
it("can use the bash parser", async () => {
parser.setLanguage(await Parser.Language.load(languageURL('bash')));
tree = parser.parse("FOO=bar echo <<EOF 2> err.txt > hello.txt \nhello\nEOF");
tree = parser.parse("FOO=bar echo <<EOF 2> err.txt > hello.txt \nhello${FOO}\nEOF");
assert.equal(
tree.rootNode.toString(),
'(program (redirected_statement ' +
'body: (command ' +
'(variable_assignment ' +
'name: (variable_name) ' +
'value: (word)) ' +
'name: (command_name (word))) ' +
'redirect: (heredoc_redirect (heredoc_start)) ' +
'redirect: (file_redirect descriptor: (file_descriptor) destination: (word)) ' +
'redirect: (file_redirect destination: (word))) ' +
'(heredoc_body))'
'(program ' +
'(redirected_statement ' +
'body: (command ' +
'(variable_assignment name: (variable_name) value: (word)) ' +
'name: (command_name (word))) ' +
'redirect: (heredoc_redirect (heredoc_start) ' +
'redirect: (file_redirect descriptor: (file_descriptor) destination: (word)) ' +
'redirect: (file_redirect destination: (word)) ' +
'(heredoc_body ' +
'(expansion (variable_name))) (heredoc_end))))'
);
}).timeout(5000);