This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-zerotierone/ext/librethinkdbxx/test/upstream/datum/bool.yaml
2017-11-02 07:05:11 -07:00

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