diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2023-11-30 22:06:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 22:06:01 +0900 |
commit | 3591ba8578b5eff96c13afc6fdfcf95a96083761 (patch) | |
tree | 087723f0e357df08e6254a440749a53b5c588444 /cli/tests | |
parent | 595a2be024b3523197557a8b122e3ce77f1dae3c (diff) |
fix(ext/node): fix os.freemem (#21347)
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); + }, +}); |