Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
duc-cnzj committed Aug 10, 2023
1 parent 66feede commit 2720ff5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions internal/grpc/services/gitconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,38 @@ func TestGitConfigSvc_Update(t *testing.T) {
assert.Equal(t, true, update.Config.IsSimpleEnv)
}

func TestConfigDefaultNotRequired(t *testing.T) {
var tests = []struct {
input *mars.Element
wantsError bool
}{
{
input: &mars.Element{
Path: "xx",
Default: "xx",
},
wantsError: false,
},
{
input: &mars.Element{
Path: "xx",
Default: "",
},
wantsError: false,
},
}
for _, test := range tests {
tt := test
t.Run("", func(t *testing.T) {
if tt.wantsError {
assert.Error(t, tt.input.Validate())
} else {
assert.NoError(t, tt.input.Validate())
}
})
}
}

func Test_getDefaultBranch(t *testing.T) {
m := gomock.NewController(t)
defer m.Finish()
Expand Down

0 comments on commit 2720ff5

Please sign in to comment.