mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 00:15:43 +03:00
* tests: swap testify for test in plugins/csi/client_test.go * tests: swap testify for test in testutil/ * tests: swap testify for test in host_test.go * tests: swap testify for test in plugin_test.go * tests: swap testify for test in utils_test.go * tests: swap testify for test in scheduler/ * tests: swap testify for test in parse_test.go * tests: swap testify for test in attribute_test.go * tests: swap testify for test in plugins/drivers/ * tests: swap testify for test in command/ * tests: fixup some test usages * go: run go mod tidy * windows: cpuset test only on linux
64 lines
1.5 KiB
Go
64 lines
1.5 KiB
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package command
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/nomad/ci"
|
|
"github.com/shoenig/test/must"
|
|
)
|
|
|
|
func TestEvalList_ArgsWithoutPageToken(t *testing.T) {
|
|
ci.Parallel(t)
|
|
|
|
cases := []struct {
|
|
cli string
|
|
expected string
|
|
}{
|
|
{
|
|
cli: "nomad eval list -page-token=abcdef",
|
|
expected: "nomad eval list",
|
|
},
|
|
{
|
|
cli: "nomad eval list -page-token abcdef",
|
|
expected: "nomad eval list",
|
|
},
|
|
{
|
|
cli: "nomad eval list -per-page 3 -page-token abcdef",
|
|
expected: "nomad eval list -per-page 3",
|
|
},
|
|
{
|
|
cli: "nomad eval list -page-token abcdef -per-page 3",
|
|
expected: "nomad eval list -per-page 3",
|
|
},
|
|
{
|
|
cli: "nomad eval list -per-page=3 -page-token abcdef",
|
|
expected: "nomad eval list -per-page=3",
|
|
},
|
|
{
|
|
cli: "nomad eval list -verbose -page-token abcdef",
|
|
expected: "nomad eval list -verbose",
|
|
},
|
|
{
|
|
cli: "nomad eval list -page-token abcdef -verbose",
|
|
expected: "nomad eval list -verbose",
|
|
},
|
|
{
|
|
cli: "nomad eval list -verbose -page-token abcdef -per-page 3",
|
|
expected: "nomad eval list -verbose -per-page 3",
|
|
},
|
|
{
|
|
cli: "nomad eval list -page-token abcdef -verbose -per-page 3",
|
|
expected: "nomad eval list -verbose -per-page 3",
|
|
},
|
|
}
|
|
|
|
for _, tc := range cases {
|
|
args := strings.Split(tc.cli, " ")
|
|
must.Eq(t, tc.expected, argsWithoutPageToken(args), must.Sprintf("for input: %s", tc.cli))
|
|
}
|
|
}
|