Improve package lib behavior and error reporting.

This commit is contained in:
James Roseborough
2010-05-16 17:53:33 +00:00
parent fe7658e83b
commit ce13cc8621
14 changed files with 46 additions and 36 deletions

View File

@@ -1,6 +1,12 @@
package.path = "?.lua;test/lua/errors/?.lua"
require 'args'
local tostring = tostring
_G.tostring = function(x)
local s = tostring(x)
return type(x)=='number' and #s>4 and (s:sub(1,5)..'...') or s
end
-- arg type tests for math library functions
local somenumber = {1,0.75,'-1','-0.25'}
local somepositive = {1,0.75,'2', '2.5'}