summaryrefslogtreecommitdiff
path: root/cli/js/tests/umask_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/tests/umask_test.ts')
-rw-r--r--cli/js/tests/umask_test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/js/tests/umask_test.ts b/cli/js/tests/umask_test.ts
new file mode 100644
index 000000000..543372a46
--- /dev/null
+++ b/cli/js/tests/umask_test.ts
@@ -0,0 +1,16 @@
+// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+import { unitTest, assertEquals } from "./test_util.ts";
+
+unitTest(
+ {
+ skip: Deno.build.os === "win"
+ },
+ function umaskSuccess(): void {
+ const prevMask = Deno.umask(0o020);
+ const newMask = Deno.umask(prevMask);
+ const finalMask = Deno.umask();
+ assertEquals(newMask, 0o020);
+ assertEquals(finalMask, prevMask);
+ assertEquals(prevMask, 0o022);
+ }
+);