From 49a0db0d2a2a697320ea95bacaca9bc61199c951 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 31 Jan 2022 14:44:19 +0900 Subject: feat(unstable): add Deno.getUid (#13496) --- cli/tests/unit/os_test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cli/tests') diff --git a/cli/tests/unit/os_test.ts b/cli/tests/unit/os_test.ts index bd6bc5747..a469c8c9f 100644 --- a/cli/tests/unit/os_test.ts +++ b/cli/tests/unit/os_test.ts @@ -202,3 +202,13 @@ Deno.test({ permissions: { env: true } }, function systemMemoryInfo() { assert(info.swapTotal >= 0); assert(info.swapFree >= 0); }); + +Deno.test({ permissions: { env: true } }, function getUid() { + if (Deno.build.os === "windows") { + assertEquals(Deno.getUid(), null); + } else { + const uid = Deno.getUid(); + assert(typeof uid === "number"); + assert(uid > 0); + } +}); -- cgit v1.2.3