summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-09 11:13:02 +0800
committerOpportunityLiu <[email protected]>2019-06-09 11:13:02 +0800
commitdca7c26579f7d7857810b58f95e177877f9933fa (patch)
treecd778ea593c68922ca15db40b99fe6a34d77853c
parent107c658ad2dade146ac368a77efeba15e29e6a93 (diff)
fix code style
-rw-r--r--tests/runner.lua10
-rw-r--r--tests/test_utils/test_assert.lua2
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/runner.lua b/tests/runner.lua
index 6ec74a35c..f84b453ba 100644
--- a/tests/runner.lua
+++ b/tests/runner.lua
@@ -36,7 +36,7 @@ function main(script)
local old_dir = os.cd(root)
-- get test functions
- local data = import("test", { root_dir = root })
+ local data = import("test", { anonymous = true })
if data.main then
-- ignore everthing when we found a main function
@@ -50,11 +50,13 @@ function main(script)
if verbose then print(">> running %s ...", k) end
context.func = v
context.funcname = k
- try{
+ try
+ {
function ()
v(context)
end,
- catch{
+ catch
+ {
function (error)
if not error:find("aborting because of ") then
print_error(error, v, "unhandled error")
@@ -67,7 +69,7 @@ function main(script)
succeed_count = succeed_count + 1
end
end
- if verbose then print(">> finined %d test method(s) ...", succeed_count) end
+ if verbose then print(">> finished %d test method(s) ...", succeed_count) end
-- leave script directory
os.cd(old_dir)
diff --git a/tests/test_utils/test_assert.lua b/tests/test_utils/test_assert.lua
index 0fac45fe3..f9af3c89a 100644
--- a/tests/test_utils/test_assert.lua
+++ b/tests/test_utils/test_assert.lua
@@ -51,7 +51,7 @@ function test_assert:will_raise(func, message_pattern)
finally{
function (ok, error)
if ok then
- self:print_error("expected raise but finined successfully", func)
+ self:print_error("expected raise but finished successfully", func)
elseif message_pattern and not string.find(error, message_pattern) then
self:print_error(format("expected raise with message ${green}%s${reset} but got ${red}%s${reset}", message_pattern, error), func)
end