mirror of
https://github.com/Egida/EndGame0.git
synced 2025-08-07 13:52:20 -04:00
EndGame v3
This commit is contained in:
commit
9e36ba54ee
646 changed files with 271674 additions and 0 deletions
15
sourcecode/gobalance/pkg/onionbalance/service_test.go
Normal file
15
sourcecode/gobalance/pkg/onionbalance/service_test.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package onionbalance
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetRollingSubArr(t *testing.T) {
|
||||
arr := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
|
||||
assert.Equal(t, []int{1, 2, 3}, getRollingSubArr(arr, 0, 3))
|
||||
assert.Equal(t, []int{4, 5, 6}, getRollingSubArr(arr, 1, 3))
|
||||
assert.Equal(t, []int{7, 8, 9}, getRollingSubArr(arr, 2, 3))
|
||||
assert.Equal(t, []int{10, 1, 2}, getRollingSubArr(arr, 3, 3))
|
||||
assert.Equal(t, []int{3, 4, 5}, getRollingSubArr(arr, 4, 3))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue