Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #3390 name&shor tag mapping failed to command input object for package gcmd #3429

Merged
merged 6 commits into from
Apr 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change panic to t.AssertNil in unit testing cases
  • Loading branch information
gqcn committed Mar 27, 2024
commit e6852cacb519442b4dac6ad4ace85daead420841
42 changes: 21 additions & 21 deletions os/gcmd/gcmd_z_unit_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ func (c Issue3390TestCase1) Index(ctx context.Context, in Issue3390Case1Input) (
}

func Test_Issue3390_Case1(t *testing.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase1{})
if err != nil {
panic(err)
}
command := &Issue3390CommandCase1{root}
gtest.C(t, func(t *gtest.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase1{})
if err != nil {
t.AssertNil(err)
}
command := &Issue3390CommandCase1{root}
value, err := command.RunWithSpecificArgs(
gctx.New(),
[]string{"main", "-a", "aaa", "-b", "bbb"},
Expand Down Expand Up @@ -85,12 +85,12 @@ func (c Issue3390TestCase2) Index(ctx context.Context, in Issue3390Case2Input) (
return
}
func Test_Issue3390_Case2(t *testing.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase2{})
if err != nil {
panic(err)
}
command := &Issue3390CommandCase2{root}
gtest.C(t, func(t *gtest.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase2{})
if err != nil {
t.AssertNil(err)
}
command := &Issue3390CommandCase2{root}
value, err := command.RunWithSpecificArgs(
gctx.New(),
[]string{"main", "-a", "aaa", "-b", "bbb"},
Expand Down Expand Up @@ -125,12 +125,12 @@ func (c Issue3390TestCase3) Index(ctx context.Context, in Issue3390Case3Input) (
return
}
func Test_Issue3390_Case3(t *testing.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase3{})
if err != nil {
panic(err)
}
command := &Issue3390CommandCase3{root}
gtest.C(t, func(t *gtest.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase3{})
if err != nil {
t.AssertNil(err)
}
command := &Issue3390CommandCase3{root}
value, err := command.RunWithSpecificArgs(
gctx.New(),
[]string{"main", "-a", "aaa", "-b", "bbb"},
Expand Down Expand Up @@ -166,12 +166,12 @@ func (c Issue3390TestCase4) Index(ctx context.Context, in Issue3390Case4Input) (
}

func Test_Issue3390_Case4(t *testing.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase4{})
if err != nil {
panic(err)
}
command := &Issue3390CommandCase4{root}
gtest.C(t, func(t *gtest.T) {
root, err := gcmd.NewFromObject(Issue3390TestCase4{})
if err != nil {
t.AssertNil(err)
}
command := &Issue3390CommandCase4{root}
value, err := command.RunWithSpecificArgs(
gctx.New(),
[]string{"main", "-a", "aaa", "-b", "bbb"},
Expand Down Expand Up @@ -219,7 +219,7 @@ func Test_Issue3417(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
command, err := gcmd.NewFromObject(Issue3417Test{})
if err != nil {
panic(err)
t.AssertNil(err)
}
value, err := command.RunWithSpecificArgs(
gctx.New(),
Expand Down
Loading