Files
regorus/tests/interpreter/cases/builtins/numbers/div.yaml
Anand Krishnamoorthi 6b87e99fb9 Tests for numbers builtins
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-02-28 09:38:40 +05:30

33 lines
573 B
YAML

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cases:
- note: div
data: {}
modules:
- |
package test
import future.keywords.if
x = 1/3
# Undefined
y if false
a = 1 / 0
b = y / 1
c = 1 / y
d = 13.3 % 3
e = 13 % 3.1
query: data.test
want_result:
x: 0.3333333333333333
- note: non-numeric
data: {}
modules:
- |
package test
x = "1" / 9
query: data.test.x
error: "`div` expects numeric argument."