mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-14 06:51:56 +00:00
63 lines
2.0 KiB
YAML
63 lines
2.0 KiB
YAML
desc: Test changefeed squashing
|
|
table_variable_name: tbl
|
|
tests:
|
|
|
|
# Check type
|
|
|
|
- py: tbl.changes(squash=true).type_of()
|
|
rb: tbl.changes(squash:true).type_of()
|
|
js: tbl.changes({squash:true}).typeOf()
|
|
ot: ("STREAM")
|
|
|
|
# comparison changes
|
|
|
|
- cd: normal_changes = tbl.changes().limit(2)
|
|
|
|
- py: false_squash_changes = tbl.changes(squash=False).limit(2)
|
|
js: false_squash_changes = tbl.changes({squash:false}).limit(2)
|
|
rb: false_squash_changes = tbl.changes(squash:false).limit(2)
|
|
|
|
- py: long_squash_changes = tbl.changes(squash=0.5).limit(1)
|
|
js: long_squash_changes = tbl.changes({squash:0.5}).limit(1)
|
|
rb: long_squash_changes = tbl.changes(squash:0.5).limit(1)
|
|
|
|
- py: squash_changes = tbl.changes(squash=true).limit(1)
|
|
js: squash_changes = tbl.changes({squash:true}).limit(1)
|
|
rb: squash_changes = tbl.changes(squash:true).limit(1)
|
|
|
|
- cd: tbl.insert({'id':100})['inserted']
|
|
js: tbl.insert({'id':100})('inserted')
|
|
ot: 1
|
|
|
|
- cd: tbl.get(100).update({'a':1})['replaced']
|
|
js: tbl.get(100).update({'a':1})('replaced')
|
|
ot: 1
|
|
|
|
- cd: normal_changes
|
|
ot: ([{'new_val':{'id':100}, 'old_val':null},
|
|
{'new_val':{'a':1, 'id':100}, 'old_val':{'id':100}}])
|
|
|
|
- cd: false_squash_changes
|
|
ot: ([{'new_val':{'id':100}, 'old_val':null},
|
|
{'new_val':{'a':1, 'id':100}, 'old_val':{'id':100}}])
|
|
|
|
- cd: long_squash_changes
|
|
ot: ([{'new_val':{'a':1, 'id':100}, 'old_val':null}])
|
|
|
|
- cd: squash_changes
|
|
ot:
|
|
js: ([{'new_val':{'a':1, 'id':100}, 'old_val':null}])
|
|
cd: ([{'new_val':{'id':100}, 'old_val':null}])
|
|
|
|
# Bad squash values
|
|
|
|
- py: tbl.changes(squash=null)
|
|
rb: tbl.changes(squash:null)
|
|
js: tbl.changes({squash:null})
|
|
ot: err('ReqlQueryLogicError', 'Expected BOOL or NUMBER but found NULL.')
|
|
|
|
- py: tbl.changes(squash=-10)
|
|
rb: tbl.changes(squash:-10)
|
|
js: tbl.changes({squash:-10})
|
|
ot: err('ReqlQueryLogicError', 'Expected BOOL or a positive NUMBER but found a negative NUMBER.')
|