Skip to content

Commit d6e14df

Browse files
committed
builtins: add numbers.range tests for floats
Signed-off-by: Dmitry Frenkel [email protected] Signed-off-by: Dmitry Frenkel <[email protected]>
1 parent 373a13e commit d6e14df

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/RegoTests/BuiltinTests/NumbersTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ extension BuiltinTests.NumbersTests {
4545
BuiltinError.evalError(
4646
msg: "operand 2 must be integer number but got floating-point number"))
4747
),
48+
BuiltinTests.TestCase(
49+
description: "when a and b are floats with integer value",
50+
name: "numbers.range",
51+
args: [1.0000, 3.0000],
52+
expected: .success([1, 2, 3])
53+
),
4854
]
4955

5056
static let rangeStepTests: [BuiltinTests.TestCase] = [
@@ -110,6 +116,12 @@ extension BuiltinTests.NumbersTests {
110116
BuiltinError.evalError(
111117
msg: "step must be a positive integer"))
112118
),
119+
BuiltinTests.TestCase(
120+
description: "when a, b and step are floats with integer value",
121+
name: "numbers.range_step",
122+
args: [1.0000, 10.000, 3.00],
123+
expected: .success([1, 4, 7, 10])
124+
),
113125
]
114126

115127
static var allTests: [BuiltinTests.TestCase] {

0 commit comments

Comments
 (0)