Skip to content

Commit

Permalink
PUC-Rio Lua compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
corsix committed Apr 9, 2016
1 parent 6a7e342 commit 1bee68f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/lib/string/dump.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local loadstring = loadstring or load

do --- Must unpatch modified bytecode with ILOOP/JLOOP etc.
local function foo()
local t = {}
Expand Down
12 changes: 10 additions & 2 deletions test/lib/string/rep.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ do --- misc
assert(y == "aaaaaaaaaa")
for i=1,100 do y = rep("ab", 10) end
assert(y == "abababababababababab")
for i=1,100 do y = rep("ab", 10, "c") end
assert(y == "abcabcabcabcabcabcabcabcabcab")
local x = "a"
for i=1,100 do y = rep(x, 10) end
assert(y == "aaaaaaaaaa")
Expand All @@ -37,10 +35,20 @@ do --- misc
assert(y == "12121212121212121212")
end

do --- separator +goto
local y
for i=1,100 do y = rep("ab", 10, "c") end
assert(y == "abcabcabcabcabcabcabcabcabcab")
end

do --- iterate to table
local t = {}
for i=1,100 do t[i] = rep("ab", i-85) end
assert(t[100] == "ababababababababababababababab")
end

do --- iterate to table with sep +goto
local t = {}
for i=1,100 do t[i] = rep("ab", i-85, "c") end
assert(t[85] == "")
assert(t[86] == "ab")
Expand Down

0 comments on commit 1bee68f

Please sign in to comment.