Compare commits

..

2 Commits

Author SHA1 Message Date
96f507fbe3 test: null args should return error 2024-02-05 14:30:23 +05:30
c9bad27e1d test: cli arg of just type 2024-02-05 14:28:32 +05:30

View File

@@ -8,7 +8,7 @@ import (
func TestParse(t *testing.T) {
t.Run("no args", func(t *testing.T) {
error,ctype,cscope,shouldCommit,shouldStage,cmessage := Parse([]string{})
assert.Equal(t, error, nil)
assert.NotEqual(t, error, nil)
assert.Equal(t, ctype, "")
assert.Equal(t, cscope, "")
var wantedMessage []string
@@ -16,4 +16,15 @@ func TestParse(t *testing.T) {
assert.Equal(t, shouldCommit, false)
assert.Equal(t, shouldStage, false)
})
t.Run("only type", func(t *testing.T) {
error,ctype,cscope,shouldCommit,shouldStage,cmessage := Parse([]string{"fix"})
assert.Equal(t, error, nil)
assert.Equal(t, ctype, "fix")
assert.Equal(t, cscope, "")
var wantedMessage []string
assert.DeepEqual(t, cmessage, wantedMessage)
assert.Equal(t, shouldCommit, false)
assert.Equal(t, shouldStage, false)
})
}