[svn-commits] mnicholson: testsuite/asterisk/trunk r122 - /asterisk/trunk/asttest/lua/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 24 14:01:31 CDT 2010


Author: mnicholson
Date: Wed Mar 24 14:01:28 2010
New Revision: 122

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=122
Log:
Modified the print function to properly support nil args in the same way the builtin print function does.

Modified:
    asterisk/trunk/asttest/lua/testlib.lua

Modified: asterisk/trunk/asttest/lua/testlib.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/asttest/lua/testlib.lua?view=diff&rev=122&r1=121&r2=122
==============================================================================
--- asterisk/trunk/asttest/lua/testlib.lua (original)
+++ asterisk/trunk/asttest/lua/testlib.lua Wed Mar 24 14:01:28 2010
@@ -25,11 +25,11 @@
 -- print to the test log instead of stdout
 function _G.print(...)
 	local msg = ""
-	for i, v in ipairs(arg) do
+	for i=1,select('#', ...) do
 		if i == 1 then
-			msg = msg .. tostring(v)
+			msg = msg .. tostring(select(i, ...))
 		else
-			msg = msg .. "\t" .. tostring(v)
+			msg = msg .. "\t" .. tostring(select(i, ...))
 		end
 	end
 	msg = msg .. "\n"




More information about the svn-commits mailing list