summaryrefslogtreecommitdiff
path: root/std/installer/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'std/installer/testdata')
-rw-r--r--std/installer/testdata/args.ts9
-rw-r--r--std/installer/testdata/echo.ts6
2 files changed, 15 insertions, 0 deletions
diff --git a/std/installer/testdata/args.ts b/std/installer/testdata/args.ts
new file mode 100644
index 000000000..484cab5ab
--- /dev/null
+++ b/std/installer/testdata/args.ts
@@ -0,0 +1,9 @@
+function args(args: string[]) {
+ const map = {};
+ for (let i = 0; i < args.length; i++) {
+ map[i] = args[i];
+ }
+ Deno.stdout.write(new TextEncoder().encode(JSON.stringify(map)));
+}
+
+args(Deno.args.slice(1));
diff --git a/std/installer/testdata/echo.ts b/std/installer/testdata/echo.ts
new file mode 100644
index 000000000..62ddd6d05
--- /dev/null
+++ b/std/installer/testdata/echo.ts
@@ -0,0 +1,6 @@
+function echo(args: string[]) {
+ const msg = args.join(", ");
+ Deno.stdout.write(new TextEncoder().encode(msg));
+}
+
+echo(Deno.args.slice(1));