diff options
| author | Saikari <[email protected]> | 2026-02-02 09:03:39 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-02-02 09:03:39 +0300 |
| commit | eb8a34c1838e72534d3662f1da6efe273d6cc370 (patch) | |
| tree | 9587d4503b3bb0a62fbf5cabb9be756aa7dd7e25 /tests/modules/stdin/test.lua | |
| parent | 33409f7b71773265fba3a6f688cdf97262770511 (diff) | |
refactor: reorder resolve_path and main function definitions for improved readability
Diffstat (limited to 'tests/modules/stdin/test.lua')
| -rw-r--r-- | tests/modules/stdin/test.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/modules/stdin/test.lua b/tests/modules/stdin/test.lua index 8aac5a38e..784e55489 100644 --- a/tests/modules/stdin/test.lua +++ b/tests/modules/stdin/test.lua @@ -1,13 +1,13 @@ -function main(t) - local function resolve_path(p) - if path.is_absolute(p) then return p end - local root = path.join(os.scriptdir(), "../../..") - local p_root = path.join(root, p) - if os.isfile(p_root) then return path.absolute(p_root) end - if os.isfile(p) then return path.absolute(p) end - return p - end +function resolve_path(p) + if path.is_absolute(p) then return p end + local root = path.join(os.scriptdir(), "../../..") + local p_root = path.join(root, p) + if os.isfile(p_root) then return path.absolute(p_root) end + if os.isfile(p) then return path.absolute(p) end + return p +end +function main(t) local xmake = path.unix(os.programfile()) if os.host() == "windows" then xmake = xmake:gsub("/", "\\") |
