nezhahq-agent/cmd/agent/main_test.go
UUBulb 060d13a759
Replace pflag with cobra, add service command (#17)
* Replace pflag with cobra, add service command

moved '-c' option to 'edit' command

* Restart after installation & add some friendly outputs

* Attempt to fix ci

* Update dependencies & revert gosec to 2.19.0

gosec 2.19.0 is the last version supports Go 1.20

* Remove gosec checks
2024-05-18 22:38:39 +08:00

26 lines
476 B
Go

package main
import (
"reflect"
"testing"
)
func Test(t *testing.T) {
cases := []struct {
start, size int
want []int
}{
{0, 2, []int{0, 1}},
{1, 2, []int{1, 0}},
{0, 3, []int{0, 1, 2}},
{1, 3, []int{1, 2, 0}},
{2, 3, []int{2, 0, 1}},
}
for _, c := range cases {
if !reflect.DeepEqual(c.want, generateQueue(c.start, c.size)) {
t.Errorf("generateQueue(%d, %d) == %d, want %d", c.start, c.size, generateQueue(c.start, c.size), c.want)
}
}
}