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

Deno.test(
  {
    ignore: Deno.build.os === "windows",
  },
  function umaskSuccess() {
    const prevMask = Deno.umask(0o020);
    const newMask = Deno.umask(prevMask);
    const finalMask = Deno.umask();
    assertEquals(newMask, 0o020);
    assertEquals(finalMask, prevMask);
  },
);