Skip to content

Commit

Permalink
fix failed unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
  • Loading branch information
wangxiaoxuan273 committed Mar 25, 2024
1 parent 5d7c072 commit 9723c49
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/oras/internal/option/target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ import (
"testing"

"github.com/spf13/cobra"
"oras.land/oras-go/v2/errdef"
"oras.land/oras-go/v2/registry/remote/errcode"
oerrors "oras.land/oras/cmd/oras/internal/errors"
)

func TestTarget_Parse_oci(t *testing.T) {
opts := Target{IsOCILayout: true}

if err := opts.Parse(); err != nil {
t.Errorf("Target.Parse() error = %v", err)
err := opts.Parse()
if !errors.Is(err, errdef.ErrInvalidReference) {
t.Errorf("Target.Parse() error = %v, expect %v", err, errdef.ErrInvalidReference)
}
if opts.Type != TargetTypeOCILayout {
t.Errorf("Target.Parse() failed, got %q, want %q", opts.Type, TargetTypeOCILayout)
Expand Down

0 comments on commit 9723c49

Please sign in to comment.