summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-19 23:51:01 +0800
committerruki <[email protected]>2019-08-19 17:06:08 +0800
commit612dd5918297120bc7f0c2011fbbce90863fafaa (patch)
treea10d62c193cfd6d947f6d785f1d9ec284a4b4e12
parent18287b32f18272b58a214bdf3870a534f1800e8c (diff)
fix typos
-rw-r--r--tests/test_utils/check.lua18
-rw-r--r--tests/test_utils/test_assert.lua24
2 files changed, 21 insertions, 21 deletions
diff --git a/tests/test_utils/check.lua b/tests/test_utils/check.lua
index 86fa5d6b5..1dd25bbf0 100644
--- a/tests/test_utils/check.lua
+++ b/tests/test_utils/check.lua
@@ -12,23 +12,23 @@ function _get_rep(value)
return tostring(value)
end
-function same(actual, expacted)
- if actual ~= actual and expacted ~= expacted then
- return true, _get_rep(actual), _get_rep(expacted)
+function same(actual, expected)
+ if actual ~= actual and expected ~= expected then
+ return true, _get_rep(actual), _get_rep(expected)
end
- return actual == expacted, _get_rep(actual), _get_rep(expacted)
+ return actual == expected, _get_rep(actual), _get_rep(expected)
end
-function equal(actual, expacted)
- local same, ap, ep = same(actual, expacted)
+function equal(actual, expected)
+ local same, ap, ep = same(actual, expected)
if same then return true, ap, ep end
- if type(expacted) == "table" and type(actual) == "table" then
+ if type(expected) == "table" and type(actual) == "table" then
local al = _tablelength(actual)
- local el = _tablelength(expacted)
+ local el = _tablelength(expected)
if al ~= el then
return false, vformat("{...(%d elements)}", al), vformat("{...(%d elements)}", el)
end
- for k, v in pairs(expacted) do
+ for k, v in pairs(expected) do
local av = actual[k]
local eq, app, epp = equal(av, v)
if not eq then
diff --git a/tests/test_utils/test_assert.lua b/tests/test_utils/test_assert.lua
index 1cf0e9386..9fbbb938b 100644
--- a/tests/test_utils/test_assert.lua
+++ b/tests/test_utils/test_assert.lua
@@ -16,32 +16,32 @@ function test_assert:require_not(value)
end
end
-function test_assert:are_same(actual, expacted)
- local r, ap, ep = check.same(actual, expacted)
+function test_assert:are_same(actual, expected)
+ local r, ap, ep = check.same(actual, expected)
if not r then
- self:print_error(format("expacted: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
+ self:print_error(format("expected: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
end
end
-function test_assert:are_not_same(actual, expacted)
- local r, ap, ep = check.same(actual, expacted)
+function test_assert:are_not_same(actual, expected)
+ local r, ap, ep = check.same(actual, expected)
if r then
- self:print_error(format("expacted: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
+ self:print_error(format("expected: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
end
end
-function test_assert:are_equal(actual, expacted)
- local r, ap, ep = check.equal(actual, expacted)
+function test_assert:are_equal(actual, expected)
+ local r, ap, ep = check.equal(actual, expected)
if not r then
- self:print_error(format("expacted: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
+ self:print_error(format("expected: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
end
end
-function test_assert:are_not_equal(actual, expacted)
- local r, ap, ep = check.equal(actual, expacted)
+function test_assert:are_not_equal(actual, expected)
+ local r, ap, ep = check.equal(actual, expected)
if r then
- self:print_error(format("expacted: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
+ self:print_error(format("expected: ${green}%s${reset}, actual ${red}%s${reset}", ep, ap), self.filename)
end
end