跳转到内容

模块:Test:修订间差异

来自流放之路2Wiki
Admin留言 | 贡献
无编辑摘要
Admin留言 | 贡献
无编辑摘要
 
第1行: 第1行:
local p = {}
local p = {}
function p.memoryTest()
function p.addTest()
     package.cpath = package.cpath or "" -- 确保非 nil
     return "1 + 2 = " .. tostring(1 + 2) -- 验证数学运算
    package.cpath = package.cpath .. ";/www/server/php/80/lib/php/extensions/no-debug-non-zts-20200930/?.so"
end
     local sandbox = require('luasandbox')
 
     return "内存用量:" .. sandbox.getMemoryUsage() .. "字节"
function p.stringTest()
     local str = "LuaSandbox"
     return "字符串反转:" .. string.reverse(str) -- 验证字符串库功能
end
end
return p
return p

2025年4月13日 (日) 01:49的最新版本

此模块的文档可以在模块:Test/doc创建

local p = {}
function p.addTest()
    return "1 + 2 = " .. tostring(1 + 2)  -- 验证数学运算
end

function p.stringTest()
    local str = "LuaSandbox"
    return "字符串反转:" .. string.reverse(str)  -- 验证字符串库功能
end
return p