From 2446d92cc7786656c9f96563f518647dc1a23ed0 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 26 Mar 2024 19:46:01 -0400 Subject: [PATCH] Add test for arguments --- src/shell/test.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/shell/test.rs b/src/shell/test.rs index fb64a4a..a7eb3d8 100644 --- a/src/shell/test.rs +++ b/src/shell/test.rs @@ -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 {