summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
l---------test/lua1
l---------test/luac1
-rw-r--r--test/printf.lua2
-rw-r--r--test/xd.lua6
4 files changed, 4 insertions, 6 deletions
diff --git a/test/lua b/test/lua
deleted file mode 120000
index 3b0b1a28..00000000
--- a/test/lua
+++ /dev/null
@@ -1 +0,0 @@
-../bin/lua \ No newline at end of file
diff --git a/test/luac b/test/luac
deleted file mode 120000
index 694bc0dc..00000000
--- a/test/luac
+++ /dev/null
@@ -1 +0,0 @@
-../bin/luac \ No newline at end of file
diff --git a/test/printf.lua b/test/printf.lua
index 66dfda65..58c63ff5 100644
--- a/test/printf.lua
+++ b/test/printf.lua
@@ -1,7 +1,7 @@
-- an implementation of printf
function printf(...)
- io.write(string.format(unpack(arg)))
+ io.write(string.format(...))
end
printf("Hello %s from %s on %s\n",os.getenv"USER" or "there",_VERSION,os.date())
diff --git a/test/xd.lua b/test/xd.lua
index 32331dc1..ebc3effc 100644
--- a/test/xd.lua
+++ b/test/xd.lua
@@ -2,12 +2,12 @@
-- usage: lua xd.lua < file
local offset=0
-
-while 1 do
+while true do
local s=io.read(16)
if s==nil then return end
io.write(string.format("%08X ",offset))
- string.gsub(s,"(.)",function (c) io.write(string.format("%02X ",string.byte(c))) end)
+ string.gsub(s,"(.)",
+ function (c) io.write(string.format("%02X ",string.byte(c))) end)
io.write(string.rep(" ",3*(16-string.len(s))))
io.write(" ",string.gsub(s,"%c","."),"\n")
offset=offset+16