updated tests and added check in connections

This commit is contained in:
2026-06-09 23:04:02 -07:00
parent 0796788fcb
commit 8b5d10cbb6
5 changed files with 6 additions and 4 deletions
+3
View File
@@ -577,6 +577,9 @@ function multi:newConnection(protect,func,kill)
end end
function c:Connect(func, name) function c:Connect(func, name)
if func == nil then
multi.error("You must provide a valid function when calling a connection")
end
self.Parent.connection_subscriptions = self.Parent.connection_subscriptions + 1 self.Parent.connection_subscriptions = self.Parent.connection_subscriptions + 1
local th local th
if thread.getRunningThread then if thread.getRunningThread then
+1 -1
View File
@@ -5,7 +5,7 @@
Requires multi.lua to be in the same directory or on the Lua path. Requires multi.lua to be in the same directory or on the Lua path.
Compatible with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT. Compatible with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT.
]] ]]
package.path = "?/init.lua;?.lua;../?/init.lua;../?.lua;" .. package.path package.path = "../?/init.lua;../?.lua;../init.lua;../?.lua;" .. package.path
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- Minimal test runner -- Minimal test runner
-1
View File
@@ -1 +0,0 @@
../
+1 -1
View File
@@ -5,7 +5,7 @@
Requires multi.lua to be in the same directory or on the Lua path. Requires multi.lua to be in the same directory or on the Lua path.
Compatible with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT. Compatible with Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT.
]] ]]
package.path = "?/init.lua;?.lua;./init.lua;./?.lua;" .. package.path package.path = "../?/init.lua;../?.lua;../init.lua;../?.lua;" .. package.path
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- Minimal test runner -- Minimal test runner
+1 -1
View File
@@ -1,4 +1,4 @@
package.path = "../?/init.lua;../?.lua;./init.lua;./?.lua;" .. package.path package.path = "../?/init.lua;../?.lua;../init.lua;../?.lua;" .. package.path
package.cpath = "C:/luaInstalls/lua5.4/lib/lua/5.4/?/core.dll;" .. package.cpath package.cpath = "C:/luaInstalls/lua5.4/lib/lua/5.4/?/core.dll;" .. package.cpath
multi, thread = require("multi"):init{error=true,warning=true,print=true, priority=true} multi, thread = require("multi"):init{error=true,warning=true,print=true, priority=true}
proc = multi:newProcessor("Thread Test",true) proc = multi:newProcessor("Thread Test",true)