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

35 lines
868 B
YAML

desc: Tests for the basic usage of the mod operation
tests:
- cd: r.expr(10).mod(3)
py:
- r.expr(10) % 3
- 10 % r.expr(3)
- r.expr(10).mod(3)
rb:
- (r 10) % 3
- r(10).mod 3
- 10 % (r 3)
ot: 1
- cd: r.expr(-10).mod(-3)
py: r.expr(-10) % -3
rb: (r -10) % -3
ot: -1
# Type errors
- cd: r.expr(4).mod('a')
py: r.expr(4) % 'a'
rb: r(4) % 'a'
ot: err('ReqlQueryLogicError', 'Expected type NUMBER but found STRING.', [1])
- cd: r.expr('a').mod(1)
py: r.expr('a') % 1
rb: r('a') % 1
ot: err('ReqlQueryLogicError', 'Expected type NUMBER but found STRING.', [0])
- cd: r.expr('a').mod('b')
py: r.expr('a') % 'b'
rb: r('a') % 'b'
ot: err('ReqlQueryLogicError', 'Expected type NUMBER but found STRING.', [0])