aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ldap/update-test.lua-for-5.2.patch
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-03-10 00:32:24 +0100
committerJakub Jirutka <jakub@jirutka.cz>2017-03-10 00:33:18 +0100
commit066b35bd070d22f59e5f3fd5be29614d34517721 (patch)
tree26a2e5056b484382130074ce02d8c83288da42da /main/lua-ldap/update-test.lua-for-5.2.patch
parent23980ddbd76a735adb0f6f8f66b4a80d72df363a (diff)
main/lua-ldap: fix segfault, iteration error and run tests
Diffstat (limited to 'main/lua-ldap/update-test.lua-for-5.2.patch')
-rw-r--r--main/lua-ldap/update-test.lua-for-5.2.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/main/lua-ldap/update-test.lua-for-5.2.patch b/main/lua-ldap/update-test.lua-for-5.2.patch
new file mode 100644
index 00000000000..1035273b935
--- /dev/null
+++ b/main/lua-ldap/update-test.lua-for-5.2.patch
@@ -0,0 +1,58 @@
+From 85891948cd7b6e9eed2c0e4b199de2a8d19a0824 Mon Sep 17 00:00:00 2001
+From: Dan Callaghan <dcallagh@redhat.com>
+Date: Mon, 30 Jun 2014 11:18:04 +1000
+Subject: [PATCH] update test.lua for 5.2
+
+Source: https://src.fedoraproject.org/cgit/rpms/lua-ldap.git/tree/0001-update-test.lua-for-5.2.patch
+diff --git a/lualdap/tests/test.lua b/lualdap/tests/test.lua
+index 2dce95b..76c8640 100755
+--- a/tests/test.lua
++++ b/tests/test.lua
+@@ -27,7 +27,7 @@ function print_attrs (dn, attrs)
+ if tv == "string" then
+ io.write (values)
+ elseif tv == "table" then
+- local n = table.getn (values)
++ local n = #values
+ for i = 1, n-1 do
+ io.write (values[i]..",")
+ end
+@@ -77,7 +77,7 @@ function test_object (obj, objmethods)
+ -- trying to set metatable.
+ assert2 (false, pcall (setmetatable, ENV, {}))
+ -- checking existence of object's methods.
+- for i = 1, table.getn (objmethods) do
++ for i = 1, #objmethods do
+ local method = obj[objmethods[i]]
+ assert2 ("function", type(method))
+ assert2 (false, pcall (method), "no 'self' parameter accepted")
+@@ -128,7 +128,7 @@ end
+ -- checks return value which should be a function AND also its return value.
+ ---------------------------------------------------------------------
+ function check_future (ret, method, ...)
+- local ok, f = pcall (method, unpack (arg))
++ local ok, f = pcall (method, ...)
+ assert (ok, f)
+ assert2 ("function", type(f))
+ assert2 (ret, f())
+@@ -377,7 +377,7 @@ tests = {
+ -- Main
+ ---------------------------------------------------------------------
+
+-if table.getn(arg) < 1 then
++if #arg < 1 then
+ print (string.format ("Usage %s host[:port] base [who [password]]", arg[0]))
+ os.exit()
+ end
+@@ -390,7 +390,7 @@ PASSWORD = arg[4]
+ require"lualdap"
+ assert (type(lualdap)=="table", "couldn't load LDAP library")
+
+-for i = 1, table.getn (tests) do
++for i = 1, #tests do
+ local t = tests[i]
+ io.write (t[1].." ...")
+ t[2] ()
+--
+1.9.3
+