lune/tests/process/exit.luau

19 lines
493 B
Lua
Raw Normal View History

local fs = require("@lune/fs")
local process = require("@lune/process")
2023-06-08 10:21:00 +01:00
local task = require("@lune/task")
2023-02-06 00:13:58 +00:00
local function assert(condition, err)
if not condition then
task.spawn(error, err)
2023-02-06 00:13:58 +00:00
process.exit(0)
end
end
local path = process.cwd .. "asdfghjkl"
assert(fs.isDir(path), "Process should exit with success")
assert(fs.isDir(path), "Process should exit with success")
assert(fs.isDir(path), "Process should exit with success")
error("Process should have exited with success...")