summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2023-11-30 22:06:01 +0900
committerGitHub <noreply@github.com>2023-11-30 22:06:01 +0900
commit3591ba8578b5eff96c13afc6fdfcf95a96083761 (patch)
tree087723f0e357df08e6254a440749a53b5c588444 /cli/tests
parent595a2be024b3523197557a8b122e3ce77f1dae3c (diff)
fix(ext/node): fix os.freemem (#21347)
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit_node/os_test.ts20
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);
+ },
+});