diff --git a/spec/lang/config/errors.lua b/spec/cli/config/errors.lua similarity index 100% rename from spec/lang/config/errors.lua rename to spec/cli/config/errors.lua diff --git a/spec/cli/run_spec.lua b/spec/cli/run_spec.lua index 26f9d7335..2b14316b7 100644 --- a/spec/cli/run_spec.lua +++ b/spec/cli/run_spec.lua @@ -370,4 +370,15 @@ describe("tl run", function() end) end) + it("compilation errors should be caught when loading modules", function() + util.run_mock_project(finally, { + dir_structure = { + ["my_module.tl"] = [[todo, write module :)]], + ["my_script.tl"] = [[local mod = require("my_module"); mod.do_things()]], + }, + cmd = "run", + args = { "my_script.tl" }, + exit_code = 1, + }) + end) end) diff --git a/spec/lang/error_reporting/module_error_spec.lua b/spec/lang/error_reporting/module_error_spec.lua deleted file mode 100644 index f0265a835..000000000 --- a/spec/lang/error_reporting/module_error_spec.lua +++ /dev/null @@ -1,31 +0,0 @@ -local tl = require("tl") -local util = require("spec.util") - -describe("Uncaught compiler errors", function() - local old_parse_program - setup(function() - old_parse_program = tl.parse_program - tl.parse_program = function(tokens, _, chunkname) - return old_parse_program(tokens, {}, chunkname) - end - end) - teardown(function() - tl.parse_program = old_parse_program - end) - it("should be reported when loading modules", function() - util.run_mock_project(finally, { - dir_structure = { - ["my_module.tl"] = [[todo, write module :)]], - ["my_script.tl"] = [[local mod = require("my_module"); mod.do_things()]], - }, - cmd = "run", - args = { "my_script.tl" }, - generated_files = {}, - popen = { - status = nil, - exit = "exit", - code = 1, - }, - }) - end) -end)