Files
ReSkate/contrib/plugins/reskate-test/plugin/checks/console.lua
T
AyeZeeBB fc4308b682 Plugins: a command ReSkate does not know goes to the game thread, where plugins have theirs
The console answered every command missing from ReSkate's own list itself, as unknown, so a
plugin's command (ptest) never reached the plugins on the game thread. Now only ReSkate's local
commands run there; anything else is queued, and the game thread tries the plugins first and
answers unknown as before when none has it. Checked in game: ptest all, 45 passed, 0 failed.
2026-10-19 12:19:39 -05:00

26 lines
1.1 KiB
Lua

local h = require("harness")
local t = h.module("console")
-- Try it by hand: ptest echo a b c
reskate.console.command("ptest echo", "Prints its words back", function(args)
reskate.console.print("ptest echo: " .. table.concat(args, " "))
end)
t.check("print works", function() reskate.console.print("ptest: console.print works") end)
t.check("a ReSkate command's name is refused", function()
h.refused(reskate.console.command, "load mine", "x", function() end)
h.refused(reskate.console.command, "plugin mine", "x", function() end)
h.refused(reskate.console.command, "help mine", "x", function() end)
end)
t.check("names must be 1 to 3 lowercase words", function()
for _, name in {"", "Bad", "a b c d", " lead", "trail ", "two spaces", "sym!"} do
h.refused(reskate.console.command, name, "x", function() end)
end
end)
t.check("a name registered already is refused", function()
h.refused(reskate.console.command, "ptest", "x", function() end)
end)
t.check("a command needs a function", function()
h.refused(reskate.console.command, "ptest other", "x", 5)
end)