Skip to content

Commit 30d4b68

Browse files
committed
test: add test for luafun compatibility
Issue automagically resolved after #33. Closes #73
1 parent d00b0ca commit 30d4b68

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/integration/pairs_test.lua

+29
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,32 @@ add('test_empty_space', function(g)
340340
]])
341341
t.assert_equals(count, 0)
342342
end)
343+
344+
add('test_luafun_compatipility', function(g)
345+
helpers.insert_objects(g, 'customers', {
346+
{
347+
id = 1, name = "Elizabeth", last_name = "Jackson",
348+
age = 12, city = "New York",
349+
}, {
350+
id = 2, name = "Mary", last_name = "Brown",
351+
age = 46, city = "Los Angeles",
352+
}, {
353+
id = 3, name = "David", last_name = "Smith",
354+
age = 33, city = "Los Angeles",
355+
},
356+
})
357+
local count = g.cluster.main_server.net_box:eval([[
358+
local crud = require('crud')
359+
local count = crud.pairs('customers'):map(function() return 1 end):sum()
360+
return count
361+
]])
362+
t.assert_equals(count, 3)
363+
364+
count = g.cluster.main_server.net_box:eval([[
365+
local crud = require('crud')
366+
local count = crud.pairs('customers',
367+
{use_tomap = true}):map(function() return 1 end):sum()
368+
return count
369+
]])
370+
t.assert_equals(count, 3)
371+
end)

0 commit comments

Comments
 (0)