Skip to content

Commit

Permalink
Add test for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Mar 26, 2024
1 parent fe66baf commit 2446d92
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/shell/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,19 @@ async fn cross_platform_shebang() {
.assert_stdout("Hello\n")
.run()
.await;

// arguments
TestBuilder::new()
.file(
"file.ts",
"#!/usr/bin/env -S deno run --allow-read\nconsole.log(Deno.args)\nconst text = Deno.readTextFileSync(import.meta.filename);\nconsole.log(text.length)\n",
)
.command("./file.ts 1 2 3")
.assert_stdout(r#"[ "1", "2", "3" ]
146
"#)
.run()
.await;
}

fn no_such_file_error_text() -> &'static str {
Expand Down

0 comments on commit 2446d92

Please sign in to comment.