From 094a74c6c63bc24096fcb5b5999728667dfc3a0c Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tsisyk.com>
Date: Mon, 24 Feb 2014 14:52:49 +0400
Subject: [PATCH] Fix tests after merging tuple-methods-ffi

Minor changes - fix msgpack.decode for zero-size arrays and update
line numbers in result files.
---
 src/lua/msgpackffi.lua | 4 ++--
 test/box/tuple.result  | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lua/msgpackffi.lua b/src/lua/msgpackffi.lua
index eff23ddc90..db264974e3 100644
--- a/src/lua/msgpackffi.lua
+++ b/src/lua/msgpackffi.lua
@@ -358,10 +358,10 @@ end
 
 local function decode_array(data, size)
     assert (type(size) == "number")
-    local arr = { [size] = 0}
+    local arr = {}
     local i
     for i=1,size,1 do
-        arr[i] = decode_r(data)
+        table.insert(arr, decode_r(data))
     end
     return arr
 end
diff --git a/test/box/tuple.result b/test/box/tuple.result
index 50713b7c5e..097b52e9cd 100644
--- a/test/box/tuple.result
+++ b/test/box/tuple.result
@@ -377,11 +377,11 @@ t:next(3)
 ...
 t:next(4)
 ---
-- error: '[string "-- tuple.lua (internal file)..."]:64: error: invalid key to ''next'''
+- error: '[string "-- tuple.lua (internal file)..."]:63: error: invalid key to ''next'''
 ...
 t:next(-1)
 ---
-- error: '[string "-- tuple.lua (internal file)..."]:64: error: invalid key to ''next'''
+- error: '[string "-- tuple.lua (internal file)..."]:63: error: invalid key to ''next'''
 ...
 t:next("fdsaf")
 ---
@@ -397,7 +397,7 @@ t=space:insert{1953719668}
 ...
 t:next(1684234849)
 ---
-- error: '[string "-- tuple.lua (internal file)..."]:64: error: invalid key to ''next'''
+- error: '[string "-- tuple.lua (internal file)..."]:63: error: invalid key to ''next'''
 ...
 t:next(1)
 ---
@@ -552,7 +552,7 @@ r = {}
 ...
 for _state, val in t:pairs(10) do table.insert(r, val) end
 ---
-- error: '[string "-- tuple.lua (internal file)..."]:64: error: invalid key to ''next'''
+- error: '[string "-- tuple.lua (internal file)..."]:63: error: invalid key to ''next'''
 ...
 r
 ---
-- 
GitLab