Files
regorus/tests/interpreter/cases/builtins/arrays/reverse.yaml
Anand Krishnamoorthi a1d0f8576a Allow with modifier for builtin and user functions (#42)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-11-12 21:39:59 -08:00

52 lines
1012 B
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: all
data: {}
modules:
- |
package test
y = [
array.reverse([1, 2, 3]),
array.reverse([]),
array.reverse(array.reverse([1, 2, 3])),
]
# Undefined
r { false }
u3 = array.reverse(r)
query: data.test
want_result:
y :
- [3, 2,1]
- []
- [1, 2, 3]
- note: reverse-invalid-arg
data: {}
modules:
- |
package test
x = array.reverse(1)
query: data.test
error: "`array.reverse` expects array argument."
- note: reverse-less-args
data: {}
modules:
- |
package test
x = array.reverse()
query: data.test
error: "expects 1 argument"
- note: reverse-more-args
data: {}
modules:
- |
package test
x = array.reverse([2], [3])
query: data.test
error: "`array.reverse` expects 1 argument"