fixed test 5.1 compatibility

This commit is contained in:
mpeterv
2014-01-13 19:01:42 +04:00
parent a5a49d13a8
commit 1a52acca75
2 changed files with 4 additions and 2 deletions

View File

@@ -3,7 +3,8 @@ local argparse = require "argparse"
describe("tests related to positional arguments", function() describe("tests related to positional arguments", function()
local function curry(f, ...) local function curry(f, ...)
local args = {...} local args = {...}
return function() return f(table.unpack(args)) end local unpack = unpack or table.unpack
return function() return f(unpack(args)) end
end end
describe("passing correct arguments", function() describe("passing correct arguments", function()

View File

@@ -3,7 +3,8 @@ local argparse = require "argparse"
describe("tests related to options", function() describe("tests related to options", function()
local function curry(f, ...) local function curry(f, ...)
local args = {...} local args = {...}
return function() return f(table.unpack(args)) end local unpack = unpack or table.unpack
return function() return f(unpack(args)) end
end end
describe("passing correct options", function() describe("passing correct options", function()