desc: Tests for basic usage of the add operation
tests:
    
    # Python supports the overloaded operator '+' in both directions
    - py: [(r.expr(1) + 1), (1 + r.expr(1)), (r.expr(1).add(1))]
      js: r(1).add(1)
      rb: [r(1) + 1, r(1).add(1)]
      ot: 2

    - py: r.expr(-1) + 1
      js: r(-1).add(1)
      rb: (r -1) + 1
      ot: 0

    - py: r.expr(1.75) + 8.5
      js: r(1.75).add(8.5)
      rb: (r 1.75) + 8.5
      ot: 10.25

    # Add is polymorphic on strings
    - py: r.expr('') + ''
      js: r('').add('')
      rb: (r '') + ''
      ot: "''"

    - py: r.expr('abc') + 'def'
      js: r('abc').add('def')
      rb: (r 'abc') + 'def'
      ot: "'abcdef'"

    # Add is polymorphic on arrays
    - py: r.expr([1,2]) + [3] + [4,5] + [6,7,8]
      js: r([1,2]).add([3]).add([4,5]).add([6,7,8])
      rb: r([1,2]) + [3] + [4,5] + [6,7,8]
      ot: [1,2,3,4,5,6,7,8]

    # All arithmetic operations (except mod) actually support arbitrary arguments
    # but this feature can't be accessed in Python because it's operators are binary
    - js: r(1).add(2,3,4,5)
      cd: []
      ot: 15

    - js: r('a').add('b', 'c', 'd')
      cd: []
      ot: "'abcd'"

    # Type errors
    - py: r.expr(1) + 'a'
      js: r(1).add('a')
      rb: r(1) + 'a'
      ot: err("RqlRuntimeError", "Expected type NUMBER but found STRING.", [1])

    - py: r.expr('a') + 1
      js: r('a').add(1)
      rb: r('a') + 1
      ot: err("RqlRuntimeError", "Expected type STRING but found NUMBER.", [1])

    - py: r.expr([]) + 1
      js: r([]).add(1)
      rb: r([]) + 1
      ot: err("RqlRuntimeError", "Expected type ARRAY but found NUMBER.", [1])

