From 58be018b11ea325940c8e63aa130d04bd972ef45 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 28 Jan 2026 22:50:25 +0800 Subject: test read /proc --- tests/modules/io/test.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/modules/io/test.lua') 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 -- cgit v1.3.1