mirror of
https://github.com/lune-org/lune.git
synced 2024-12-14 14:11:04 +00:00
23 lines
481 B
Lua
23 lines
481 B
Lua
local util = {}
|
|
|
|
function util.pass(method, url, message)
|
|
local response = net.request({
|
|
method = method,
|
|
url = url,
|
|
})
|
|
if not response.ok then
|
|
error(string.format("%s failed!\nResponse: %s", message, stdio.format(response)))
|
|
end
|
|
end
|
|
|
|
function util.fail(method, url, message)
|
|
local response = net.request({
|
|
method = method,
|
|
url = url,
|
|
})
|
|
if response.ok then
|
|
error(string.format("%s passed!\nResponse: %s", message, stdio.format(response)))
|
|
end
|
|
end
|
|
|
|
return util
|