@@ -340,3 +340,32 @@ add('test_empty_space', function(g)
340340 ]] )
341341 t .assert_equals (count , 0 )
342342end )
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