summaryrefslogtreecommitdiff
path: root/tests/modules/io/test.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-28 17:36:26 +0800
committerGitHub <[email protected]>2026-01-28 17:36:26 +0800
commit11dd96c3a7edd0fbefbf3da80deab5b39fb347bf (patch)
tree4ac263e9346fec6376eb9512e929eeb4039c8699 /tests/modules/io/test.lua
parente1d3f3555235dc41e530f563140850a3ee8b3e2b (diff)
parentd0e47424619d453a1c74a7b248c26bab82bdd876 (diff)
Merge pull request #7273 from xmake-io/io
Improve io.read and io.readfile
Diffstat (limited to 'tests/modules/io/test.lua')
-rw-r--r--tests/modules/io/test.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/modules/io/test.lua b/tests/modules/io/test.lua
index 2b8bad8bf..a87151e32 100644
--- a/tests/modules/io/test.lua
+++ b/tests/modules/io/test.lua
@@ -160,3 +160,17 @@ function test_convert(t)
os.tryrm("temp")
end
+
+function test_read_proc_cpuinfo(t)
+ if not is_host("linux") then
+ return t:skip("wrong host platform")
+ end
+ if not os.isfile("/proc/cpuinfo") then
+ return t:skip("missing /proc/cpuinfo")
+ end
+ local data = io.readfile("/proc/cpuinfo", {encoding = "binary"})
+ t:require(data and #data > 0)
+
+ local data2 = io.readfile("/proc/cpuinfo")
+ t:require(data2 and #data2 > 0)
+end