Changeset

7516:f74ff35a4b03

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 23 Jul 2016 18:58:58 +0200
parents 7510:8a0a50e8ef2d (current diff) 7515:9e48299799d8 (diff)
children 7517:e81ceca529c5
files
diffstat 5 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_utf8.lua	Thu Jul 21 12:24:18 2016 +0100
+++ b/tests/test_utf8.lua	Sat Jul 23 18:58:58 2016 +0200
@@ -11,7 +11,6 @@
 		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);
--- a/tests/test_util_http.lua	Thu Jul 21 12:24:18 2016 +0100
+++ b/tests/test_util_http.lua	Sat Jul 23 18:58:58 2016 +0200
@@ -25,13 +25,17 @@
 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
--- a/tests/test_util_multitable.lua	Thu Jul 21 12:24:18 2016 +0100
+++ b/tests/test_util_multitable.lua	Sat Jul 23 18:58:58 2016 +0200
@@ -27,7 +27,7 @@
 			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
--- a/tests/test_util_uuid.lua	Thu Jul 21 12:24:18 2016 +0100
+++ b/tests/test_util_uuid.lua	Sat Jul 23 18:58:58 2016 +0200
@@ -13,7 +13,7 @@
 }, "%-") .. "$";
 
 function generate(generate)
-	for i = 1, 100 do
+	for _ = 1, 100 do
 		assert_is(generate():match(pattern));
 	end
 end
--- a/util/sql.lua	Thu Jul 21 12:24:18 2016 +0100
+++ b/util/sql.lua	Sat Jul 23 18:58:58 2016 +0200
@@ -49,7 +49,7 @@
 
 function table_mt:__tostring()
 	local s = { 'name="'..self.__table__.name..'"' }
-	for i,col in ipairs(self.__table__) do
+	for _, col in ipairs(self.__table__) do
 		s[#s+1] = tostring(col);
 	end
 	return 'Table{ '..t_concat(s, ", ")..' }'
@@ -294,7 +294,7 @@
 	end
 	local success,err = self:execute(sql);
 	if not success then return success,err; end
-	for i,v in ipairs(table.__table__) do
+	for _, v in ipairs(table.__table__) do
 		if is_index(v) then
 			self:_create_index(v);
 		end