aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.lua')
-rw-r--r--test/test.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index 5a0fae05..8503615d 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -3120,6 +3120,18 @@ function test_run_build()
-- TODO: project whose makefile is autodetected.
end
+function test_run_test()
+ textadept.run.test_commands[_HOME] = function()
+ return 'lua modules/textadept/run/test.lua', _HOME .. '/test/' -- intentional trailing '/'
+ end
+ textadept.run.test(_HOME)
+ if #_VIEWS > 1 then view:unsplit() end
+ ui.update() -- process output
+ assert(buffer:get_text():find('test%.lua'), 'did not run test command')
+ assert(buffer:get_text():find('assertion failed!'), 'assertion failure not detected')
+ buffer:close()
+end
+
function test_run_goto_internal_lua_error()
xpcall(error, function(message) events.emit(events.ERROR, debug.traceback(message)) end, 'internal error', 2)
if #_VIEWS > 1 then view:unsplit() end