mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(mathutil): stop stepped ranges when values stop increasing (#376)
This commit is contained in:
1 parent
b40eea78c3
commit
b282ada39e
2 files changed
+11
-2
No files matched your search
@@ -260,6 +260,10 @@ func TestRangeWithStep(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
assert := internal.NewAssert(t, "TestRangeWithStep")
|
||||
assert.Equal([]int8{120}, RangeWithStep[int8](120, 125, 10))
|
||||
assert.Equal([]uint8{250}, RangeWithStep[uint8](250, 253, 10))
|
||||
assert.Equal([]int{}, RangeWithStep(1, 4, -1))
|
||||
assert.Equal([]float64{1e20}, RangeWithStep(1e20, 1e21, 1.0))
|
||||
|
||||
result1 := RangeWithStep(1, 4, 1)
|
||||
result2 := RangeWithStep(1, -1, 0)
|
||||
|
||||
Reference in new issue
Block a user