diff --git a/pkg/cmd/attestation/download/download_test.go b/pkg/cmd/attestation/download/download_test.go index af43aa492..0762a29da 100644 --- a/pkg/cmd/attestation/download/download_test.go +++ b/pkg/cmd/attestation/download/download_test.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "net/http" + "strings" "testing" "github.com/cli/cli/v2/pkg/cmd/attestation/api" @@ -15,7 +16,6 @@ import ( "github.com/cli/cli/v2/pkg/httpmock" "github.com/cli/cli/v2/pkg/iostreams" - "github.com/google/shlex" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -153,13 +153,12 @@ func TestNewDownloadCmd(t *testing.T) { return nil }) - argv, err := shlex.Split(tc.cli) - assert.NoError(t, err) + argv := strings.Split(tc.cli, " ") cmd.SetArgs(argv) cmd.SetIn(&bytes.Buffer{}) cmd.SetOut(&bytes.Buffer{}) cmd.SetErr(&bytes.Buffer{}) - _, err = cmd.ExecuteC() + _, err := cmd.ExecuteC() if tc.wantsErr { assert.Error(t, err) return diff --git a/pkg/cmd/attestation/tufrootverify/tufrootverify_test.go b/pkg/cmd/attestation/tufrootverify/tufrootverify_test.go index 1e0868c2e..004f25618 100644 --- a/pkg/cmd/attestation/tufrootverify/tufrootverify_test.go +++ b/pkg/cmd/attestation/tufrootverify/tufrootverify_test.go @@ -2,13 +2,13 @@ package tufrootverify import ( "bytes" + "strings" "testing" "github.com/cli/cli/v2/pkg/cmd/attestation/test" "github.com/cli/cli/v2/pkg/cmdutil" "github.com/cli/cli/v2/pkg/iostreams" - "github.com/google/shlex" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -47,13 +47,12 @@ func TestNewTUFRootVerifyCmd(t *testing.T) { return nil }) - argv, err := shlex.Split(tc.cli) - assert.NoError(t, err) + argv := strings.Split(tc.cli, " ") cmd.SetArgs(argv) cmd.SetIn(&bytes.Buffer{}) cmd.SetOut(&bytes.Buffer{}) cmd.SetErr(&bytes.Buffer{}) - _, err = cmd.ExecuteC() + _, err := cmd.ExecuteC() if tc.wantsErr { assert.Error(t, err) return diff --git a/pkg/cmd/attestation/verify/verify_test.go b/pkg/cmd/attestation/verify/verify_test.go index bf506f2c8..c7eda6f19 100644 --- a/pkg/cmd/attestation/verify/verify_test.go +++ b/pkg/cmd/attestation/verify/verify_test.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "net/http" + "strings" "testing" "github.com/cli/cli/v2/pkg/cmd/attestation/api" @@ -15,7 +16,6 @@ import ( "github.com/cli/cli/v2/pkg/httpmock" "github.com/cli/cli/v2/pkg/iostreams" - "github.com/google/shlex" "github.com/stretchr/testify/assert" "github.com/in-toto/in-toto-golang/in_toto" @@ -197,13 +197,12 @@ func TestNewVerifyCmd(t *testing.T) { return nil }) - argv, err := shlex.Split(tc.cli) - assert.NoError(t, err) + argv := strings.Split(tc.cli, " ") cmd.SetArgs(argv) cmd.SetIn(&bytes.Buffer{}) cmd.SetOut(&bytes.Buffer{}) cmd.SetErr(&bytes.Buffer{}) - _, err = cmd.ExecuteC() + _, err := cmd.ExecuteC() if tc.wantsErr { assert.Error(t, err) return