Skip to content

Commit ffee6fe

Browse files
committed
Add failing test: Fix Flow.range to handle negative steps (descending ranges)
1 parent 3182ccd commit ffee6fe

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/src/test/scala/ox/flow/FlowOpsFactoryMethodsTest.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ class FlowOpsFactoryMethodsTest extends AnyFlatSpec with Matchers:
2525
Flow.range(1, 5, 1).runToList() shouldBe List(1, 2, 3, 4, 5)
2626
Flow.range(1, 5, 2).runToList() shouldBe List(1, 3, 5)
2727
Flow.range(1, 11, 3).runToList() shouldBe List(1, 4, 7, 10)
28+
29+
it should "produce a descending range with a negative step" in:
30+
Flow.range(5, 1, -1).runToList() shouldBe List(5, 4, 3, 2, 1)
31+
Flow.range(10, 0, -2).runToList() shouldBe List(10, 8, 6, 4, 2, 0)
2832
end FlowOpsFactoryMethodsTest

0 commit comments

Comments
 (0)