Improve iolib test.

This commit is contained in:
James Roseborough
2012-09-19 05:37:39 +00:00
parent 0f70a8e962
commit a8aeddfc60
3 changed files with 10 additions and 1 deletions

View File

@@ -5,6 +5,15 @@ print( 'platform', platform )
--
-- C version on Windows will add change \n into \r\n for text files at least
--
local tostr,files,nfiles = tostring,{},0
tostring = function(x)
local s = tostr(x)
if s:sub(1,4) ~= 'file' then return s end
if files[s] then return files[s] end
files[s] = 'file.'..nfiles
nfiles = nfiles + 1
return files[s]
end
print( io ~= nil )
print( io.open ~= nil )
print( io.stdin ~= nil )

Binary file not shown.