mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-13 22:41:57 +00:00
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
desc: Tests RQL range generation
|
|
tests:
|
|
- cd: r.range().type_of()
|
|
ot: 'STREAM'
|
|
|
|
- cd: r.range().limit(4)
|
|
ot: [0, 1, 2, 3]
|
|
|
|
- cd: r.range(4)
|
|
ot: [0, 1, 2, 3]
|
|
|
|
- cd: r.range(2, 5)
|
|
ot: [2, 3, 4]
|
|
|
|
- cd: r.range(0)
|
|
ot: []
|
|
|
|
- cd: r.range(5, 2)
|
|
ot: []
|
|
|
|
- cd: r.range(-5, -2)
|
|
ot: [-5, -4, -3]
|
|
|
|
- cd: r.range(-5, 2)
|
|
ot: [-5, -4, -3, -2, -1, 0, 1]
|
|
|
|
- cd: r.range(2, 5, 8)
|
|
ot: err("ReqlCompileError", "Expected between 0 and 2 arguments but found 3.", [])
|
|
|
|
- cd: r.range("foo")
|
|
ot: err("ReqlQueryLogicError", "Expected type NUMBER but found STRING.", [])
|
|
|
|
# Using 9007199254740994 instead of 9007199254740993 due to #2157
|
|
- cd: r.range(9007199254740994)
|
|
ot: err_regex("ReqlQueryLogicError", "Number not an integer \\(>2\\^53\\). 9007199254740994", [])
|
|
|
|
- cd: r.range(-9007199254740994)
|
|
ot: err_regex("ReqlQueryLogicError", "Number not an integer \\(<-2\\^53\\). -9007199254740994", [])
|
|
|
|
- cd: r.range(0.5)
|
|
ot: err_regex("ReqlQueryLogicError", "Number not an integer. 0\\.5", [])
|
|
|
|
- cd: r.range().count()
|
|
ot: err("ReqlQueryLogicError", "Cannot use an infinite stream with an aggregation function (`reduce`, `count`, etc.) or coerce it to an array.", [])
|
|
|
|
- cd: r.range().coerce_to("ARRAY")
|
|
ot: err("ReqlQueryLogicError", "Cannot use an infinite stream with an aggregation function (`reduce`, `count`, etc.) or coerce it to an array.", [])
|
|
|
|
- cd: r.range().coerce_to("OBJECT")
|
|
ot: err("ReqlQueryLogicError", "Cannot use an infinite stream with an aggregation function (`reduce`, `count`, etc.) or coerce it to an array.", [])
|
|
|
|
- cd: r.range(4).count()
|
|
ot: 4
|