Files
regorus/tests/interpreter/cases/builtins/numbers/div.yaml
Anand Krishnamoorthi f6140b6be5 More builtins and semantic improvements (#66)
- base64 builtins
- base64url builtins
- jsonschema builtins
- json.remove builtin
- handle composite index variables
- use dashu_float since rust_decimal has lesser precision

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-12-21 13:34:48 -08:00

50 lines
871 B
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: div
data: {}
modules:
- |
package test
import future.keywords.if
# Undefined
y if false
b = y / 1
c = 1 / y
d = 15.3 / 3
e = 13 / 4
z {
x = 1/3
y = 0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
x == y
}
query: data.test
want_result:
d: 5.1
e: 3.25
z: true
- note: non-numeric
data: {}
modules:
- |
package test
x = "1" / 9
query: data.test.x
error: "`div` expects numeric argument."
- note: div by zero
data: {}
modules:
- |
package test
a = 1/ 0
query: data.test
error: divide by zero