mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 15:33:12 +09:00
Cover UDP error paths and sendUdp in tests
Codecov flagged the sendUdp methods on Instance and BaseInstancePlugin, the bind, socket error, malformed packet and send failure paths in FactorioServer, and the --enable-lua-udp branch of startScenario. Add unit tests for each and start the integration scenario test with UDP enabled on Factorio 2.0.59+. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
788ae17657
commit
4b0238b64b
5 files changed
+95
No files matched your search
@@ -179,6 +179,8 @@ describe("Integration of host/src/server", function() {
|
||||
slowTest(this);
|
||||
log(".startScenario()");
|
||||
|
||||
// --enable-lua-udp was added in Factorio 2.0.59
|
||||
server.enableLuaUdp = lib.integerFullVersion(server.version) >= lib.integerFullVersion("2.0.59");
|
||||
let pass = false;
|
||||
function filter(output) {
|
||||
if (output.message === "test_scenario init") {
|
||||
@@ -191,6 +193,7 @@ describe("Integration of host/src/server", function() {
|
||||
|
||||
log(".stop()");
|
||||
await server.stop();
|
||||
server.enableLuaUdp = false;
|
||||
|
||||
server.off("output", filter);
|
||||
assert(pass, "server did not output line from test scenario");
|
||||
|
||||
Reference in new issue
Block a user