diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit_node/os_test.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/tests/unit_node/os_test.ts b/cli/tests/unit_node/os_test.ts index 2d0d3a8c8..54dc375bb 100644 --- a/cli/tests/unit_node/os_test.ts +++ b/cli/tests/unit_node/os_test.ts @@ -289,3 +289,23 @@ Deno.test({ await child.status; }, }); + +Deno.test({ + name: + "os.freemem() is equivalent of Deno.systemMemoryInfo().free except on linux", + ignore: Deno.build.os === "linux", + fn() { + const diff = Math.abs(os.freemem() - Deno.systemMemoryInfo().free); + assert(diff < 10_000); + }, +}); + +Deno.test({ + name: + "os.freemem() is equivalent of Deno.systemMemoryInfo().available on linux", + ignore: Deno.build.os !== "linux", + fn() { + const diff = Math.abs(os.freemem() - Deno.systemMemoryInfo().available); + assert(diff < 10_000); + }, +}); |