summaryrefslogtreecommitdiff
path: root/cli/js/tests/umask_test.ts
blob: 71a5e71f8c5d6c52b63104b56220810857a2d194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { unitTest, assertEquals } from "./test_util.ts";

unitTest(
  {
    ignore: 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);
  }
);