diff options
author | Kim Alvefur <zash@zash.se> | 2016-07-23 18:58:58 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-07-23 18:58:58 +0200 |
commit | 35a906e990f5e38c08688997815345f7071b7b4f (patch) | |
tree | 5b3d9eec6726161611eafac7f8efdaa3b87d4dff /tests | |
parent | e8c53c5d209281433aedfd5b3d70e10b06d1dac5 (diff) | |
parent | f0e16572c0b2e83b9d174733ef8b627711dd0031 (diff) | |
download | prosody-35a906e990f5e38c08688997815345f7071b7b4f.tar.gz prosody-35a906e990f5e38c08688997815345f7071b7b4f.zip |
Merge 0.10->trunk
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_utf8.lua | 1 | ||||
-rw-r--r-- | tests/test_util_http.lua | 20 | ||||
-rw-r--r-- | tests/test_util_multitable.lua | 2 | ||||
-rw-r--r-- | tests/test_util_uuid.lua | 2 |
4 files changed, 14 insertions, 11 deletions
diff --git a/tests/test_utf8.lua b/tests/test_utf8.lua index 481eff5d..db59a70f 100644 --- a/tests/test_utf8.lua +++ b/tests/test_utf8.lua @@ -11,7 +11,6 @@ function valid() if expect ~= "pass" and expect ~= "fail" then error("unknown expectation: "..line:match("^[^:]+")); end - local prefix, style = " ", valid_style; local valid = utf8.valid(data); assert_equal(valid, utf8.valid(data.." ")); assert_equal(valid, expect == "pass", line); diff --git a/tests/test_util_http.lua b/tests/test_util_http.lua index a195df6b..d9cc2779 100644 --- a/tests/test_util_http.lua +++ b/tests/test_util_http.lua @@ -25,13 +25,17 @@ function formencode(formencode) end function formdecode(formdecode) - local t = formdecode("one=1&two=2"); - assert_table(t[1]); - assert_equal(t[1].name, "one"); assert_equal(t[1].value, "1"); - assert_table(t[2]); - assert_equal(t[2].name, "two"); assert_equal(t[2].value, "2"); + do + local t = formdecode("one=1&two=2"); + assert_table(t[1]); + assert_equal(t[1].name, "one"); assert_equal(t[1].value, "1"); + assert_table(t[2]); + assert_equal(t[2].name, "two"); assert_equal(t[2].value, "2"); + end - local t = formdecode("one+two=1&two+one%26=2"); - assert_equal(t[1].name, "one two"); assert_equal(t[1].value, "1"); - assert_equal(t[2].name, "two one&"); assert_equal(t[2].value, "2"); + do + local t = formdecode("one+two=1&two+one%26=2"); + assert_equal(t[1].name, "one two"); assert_equal(t[1].value, "1"); + assert_equal(t[2].name, "two one&"); assert_equal(t[2].value, "2"); + end end diff --git a/tests/test_util_multitable.lua b/tests/test_util_multitable.lua index 4a8dd14c..45727bc3 100644 --- a/tests/test_util_multitable.lua +++ b/tests/test_util_multitable.lua @@ -27,7 +27,7 @@ function get(get, multitable) return true, "has-all"; end for n=1,select('#', ...) do should_have[select(n, ...)] = true; end - for n, item in ipairs(list) do + for _, item in ipairs(list) do if not should_have[item] then return false, "too-many"; end should_have[item] = nil; end diff --git a/tests/test_util_uuid.lua b/tests/test_util_uuid.lua index d3f72bb4..07d75025 100644 --- a/tests/test_util_uuid.lua +++ b/tests/test_util_uuid.lua @@ -13,7 +13,7 @@ local pattern = "^" .. table.concat({ }, "%-") .. "$"; function generate(generate) - for i = 1, 100 do + for _ = 1, 100 do assert_is(generate():match(pattern)); end end |