From d437cfe6491782b69f92aec8bb036bebe28ea86b Mon Sep 17 00:00:00 2001 From: lethosor Date: Tue, 15 Dec 2020 21:36:57 -0500 Subject: [PATCH] Add test for invalid job types in workflow's job_outputs --- plugins/lua/workflow.lua | 6 ++++++ test/plugins/workflow.lua | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 test/plugins/workflow.lua diff --git a/plugins/lua/workflow.lua b/plugins/lua/workflow.lua index 01531b8a6..bdcd02bcb 100644 --- a/plugins/lua/workflow.lua +++ b/plugins/lua/workflow.lua @@ -355,4 +355,10 @@ function listWeakenedConstraints(outputs) return variants end +if dfhack.internal.IN_TEST then + test_data = { + job_outputs = job_outputs, + } +end + return _ENV diff --git a/test/plugins/workflow.lua b/test/plugins/workflow.lua new file mode 100644 index 000000000..af8d32793 --- /dev/null +++ b/test/plugins/workflow.lua @@ -0,0 +1,7 @@ +local workflow = require('plugins.workflow') + +function test.job_outputs() + for job_type in pairs(workflow.test_data.job_outputs) do + expect.true_(df.job_type[job_type], "Found unrecognized job type: " .. tostring(job_type)) + end +end