mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-15 15:31:58 +00:00
18 lines
711 B
YAML
18 lines
711 B
YAML
desc: Test that we do not crash on an error during a function called at unsharding
|
|
table_variable_name: tbl
|
|
tests:
|
|
- cd: tbl.insert([ {'id':0, 'a':5}, {'id':1, 'a':6} ])
|
|
ot: partial({'inserted':2})
|
|
|
|
# Test bare reduce
|
|
- rb: tbl.reduce{|x,y| r.object('a', r.add(x['a'], y['a']))}
|
|
py: tbl.reduce(lambda x,y:r.object('a', r.add(x['a'], y['a'])))
|
|
js: tbl.reduce(function(x,y){return r.object('a', r.add(x('a'), y('a')));})
|
|
ot: ({'a':11})
|
|
|
|
# Test reduce with a function that errors
|
|
- rb: tbl.reduce{|x,y| r.expr(0)[0]}
|
|
py: tbl.reduce(lambda x,y:r.expr(0)[0])
|
|
js: tbl.reduce(function(x,y){return r.expr(0)(0);})
|
|
ot: err('ReqlQueryLogicError','Cannot convert NUMBER to SEQUENCE')
|