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

38 lines
897 B
YAML

desc: Tests for basic usage of the subtraction operation
tests:
- cd: r.expr(1).sub(1)
py:
- r.expr(1) - 1
- 1 - r.expr(1)
- r.expr(1).sub(1)
rb:
- (r 1) - 1
- 1 - (r 1)
- r(1).sub(1)
- r.expr(1).sub(1)
ot: 0
- cd: r.expr(-1).sub(1)
py: r.expr(-1) - 1
rb: (r -1) - 1
ot: -2
- cd: r.expr(1.75).sub(8.5)
py: r.expr(1.75) - 8.5
rb: (r 1.75) - 8.5
ot: -6.75
- cd: r.expr(1).sub(2,3,4,5)
ot: -13
# Type errors
- cd: r.expr('a').sub(0.8)
ot: err('ReqlQueryLogicError', 'Expected type NUMBER but found STRING.', [0])
- cd: r.expr(1).sub('a')
ot: err('ReqlQueryLogicError', 'Expected type NUMBER but found STRING.', [1])
- cd: r.expr('b').sub('a')
ot: err('ReqlQueryLogicError', 'Expected type NUMBER but found STRING.', [0])