48 lines
872 B
YAML
48 lines
872 B
YAML
desc: Tests of conversion to and from the RQL bool type
|
|
tests:
|
|
- py: r.expr(True)
|
|
js:
|
|
- r.expr(true)
|
|
- r(true)
|
|
rb: r true
|
|
ot: true
|
|
|
|
- py: r.expr(False)
|
|
js:
|
|
- r.expr(false)
|
|
- r(false)
|
|
rb: r false
|
|
ot: false
|
|
|
|
- cd: r.expr(False).type_of()
|
|
ot: 'BOOL'
|
|
|
|
# test coercions
|
|
- cd: r.expr(True).coerce_to('string')
|
|
ot: 'true'
|
|
|
|
- cd: r.expr(True).coerce_to('bool')
|
|
ot: True
|
|
|
|
- cd: r.expr(False).coerce_to('bool')
|
|
ot: False
|
|
|
|
- cd: r.expr(null).coerce_to('bool')
|
|
ot: False
|
|
|
|
- cd: r.expr(0).coerce_to('bool')
|
|
ot: True
|
|
|
|
- cd: r.expr('false').coerce_to('bool')
|
|
ot: True
|
|
|
|
- cd: r.expr('foo').coerce_to('bool')
|
|
ot: True
|
|
|
|
- cd: r.expr([]).coerce_to('bool')
|
|
ot: True
|
|
|
|
- cd: r.expr({}).coerce_to('bool')
|
|
ot: True
|
|
|