summaryrefslogtreecommitdiff
path: root/cli/tests/stdout_write_all.ts
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-12-17 22:01:47 +0800
committerGitHub <noreply@github.com>2020-12-17 15:01:47 +0100
commit55dc467b419b8e5897b1c832b04d63e383253d84 (patch)
treed4bbbe9637eed4e367eb2359735b9ad62b0181cb /cli/tests/stdout_write_all.ts
parent825293737004cbf94638458f77fa13fd1b07aef2 (diff)
test(cli): ensure await all on stdout does not deadlock (#8802)
Diffstat (limited to 'cli/tests/stdout_write_all.ts')
-rw-r--r--cli/tests/stdout_write_all.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/tests/stdout_write_all.ts b/cli/tests/stdout_write_all.ts
new file mode 100644
index 000000000..c82a0ca7d
--- /dev/null
+++ b/cli/tests/stdout_write_all.ts
@@ -0,0 +1,8 @@
+const encoder = new TextEncoder();
+const pending = [
+ Deno.stdout.write(encoder.encode("done\n")),
+ Deno.stdout.write(encoder.encode("done\n")),
+];
+
+await Promise.all(pending);
+await Deno.stdout.write(encoder.encode("complete\n"));