2017-11-02 07:05:11 -07:00

49 lines
1.2 KiB
YAML

# note: this should be converted to a full test when #4030 is completed
desc: test that r.union is a top level function
table_variable_name: tbl
tests:
# == setup
- def: data = [{'id':1}, {'id':2}, {'id':3}, {'id':4}, {'id':5}, {'id':6}]
- def: changes = [{'id':7}, {'id':8}, {'id':9}, {'id':10}]
- cd: tbl.insert(data)
ot: partial({'errors':0, 'inserted':6})
- cd: tbl.count()
ot: (6)
# == tests
# - two streams
- cd: tbl.union(tbl)
ot:
cd: bag(data * 2)
js: bag(data.concat(data))
# - top level object
- cd: r.union(tbl, tbl)
ot:
cd: bag(data * 2)
js: bag(data.concat(data))
# # - two changefeeds
#
# - cd: unionFeed = tbl.changes().union(tbl.changes())['new_val']
# js: unionFeed = tbl.changes().union(tbl.changes())('new_val')
# - cd: tbl.insert(changes)
# - cd: fetch(unionFeed, 4 * 2)
# ot:
# cd: bag(changes * 2)
# js: bag(changes.concat(changes))
#
# # == errors
#
# # - order by
#
# - cd: tbl.union(tbl).changes().order_by('id')
# ot: err('ReqlRuntimeError', "Cannot call a terminal (`reduce`, `count`, etc.) on an infinite stream (such as a changefeed).")
#