@@ -127,8 +127,15 @@ add('test_pairs_no_conditions', function(g)
127127
128128 table.sort (customers , function (obj1 , obj2 ) return obj1 .id < obj2 .id end )
129129
130- -- no after
131- local objects , err = g .cluster .main_server .net_box :eval ([[
130+ local raw_rows = {
131+ {1 , 477 , ' Elizabeth' , ' Jackson' , 12 , ' New York' },
132+ {2 , 401 , ' Mary' , ' Brown' , 46 , ' Los Angeles' },
133+ {3 , 2804 , ' David' , ' Smith' , 33 , ' Los Angeles' },
134+ {4 , 1161 , ' William' , ' White' , 81 , ' Chicago' },
135+ }
136+
137+ -- without conditions and options
138+ local objects = g .cluster .main_server .net_box :eval ([[
132139 local crud = require('crud')
133140
134141 local objects = {}
@@ -138,8 +145,33 @@ add('test_pairs_no_conditions', function(g)
138145
139146 return objects
140147 ]] )
148+ t .assert_equals (objects , raw_rows )
149+
150+ -- with use_tomap=false (the raw tuples returned)
151+ local objects = g .cluster .main_server .net_box :eval ([[
152+ local crud = require('crud')
153+
154+ local objects = {}
155+ for _, object in crud.pairs('customers', nil, {use_tomap = false}) do
156+ table.insert(objects, object)
157+ end
158+
159+ return objects
160+ ]] )
161+ t .assert_equals (objects , raw_rows )
162+
163+ -- no after
164+ local objects = g .cluster .main_server .net_box :eval ([[
165+ local crud = require('crud')
166+
167+ local objects = {}
168+ for _, object in crud.pairs('customers', nil, {use_tomap = true}) do
169+ table.insert(objects, object)
170+ end
171+
172+ return objects
173+ ]] )
141174
142- t .assert_equals (err , nil )
143175 t .assert_equals (objects , customers )
144176
145177 -- after obj 2
@@ -150,7 +182,7 @@ add('test_pairs_no_conditions', function(g)
150182 local after = ...
151183
152184 local objects = {}
153- for _, object in crud.pairs('customers', nil, {after = after}) do
185+ for _, object in crud.pairs('customers', nil, {after = after, use_tomap = true }) do
154186 table.insert(objects, object)
155187 end
156188
@@ -168,7 +200,7 @@ add('test_pairs_no_conditions', function(g)
168200 local after = ...
169201
170202 local objects = {}
171- for _, object in crud.pairs('customers', nil, {after = after}) do
203+ for _, object in crud.pairs('customers', nil, {after = after, use_tomap = true }) do
172204 table.insert(objects, object)
173205 end
174206
@@ -209,7 +241,7 @@ add('test_ge_condition_with_index', function(g)
209241 local conditions = ...
210242
211243 local objects = {}
212- for _, object in crud.pairs('customers', conditions) do
244+ for _, object in crud.pairs('customers', conditions, {use_tomap = true} ) do
213245 table.insert(objects, object)
214246 end
215247
@@ -227,7 +259,7 @@ add('test_ge_condition_with_index', function(g)
227259 local conditions, after = ...
228260
229261 local objects = {}
230- for _, object in crud.pairs('customers', conditions, {after = after}) do
262+ for _, object in crud.pairs('customers', conditions, {after = after, use_tomap = true }) do
231263 table.insert(objects, object)
232264 end
233265
@@ -268,7 +300,7 @@ add('test_le_condition_with_index', function(g)
268300 local conditions = ...
269301
270302 local objects = {}
271- for _, object in crud.pairs('customers', conditions) do
303+ for _, object in crud.pairs('customers', conditions, {use_tomap = true} ) do
272304 table.insert(objects, object)
273305 end
274306
@@ -286,7 +318,7 @@ add('test_le_condition_with_index', function(g)
286318 local conditions, after = ...
287319
288320 local objects = {}
289- for _, object in crud.pairs('customers', conditions, {after = after}) do
321+ for _, object in crud.pairs('customers', conditions, {after = after, use_tomap = true }) do
290322 table.insert(objects, object)
291323 end
292324
0 commit comments