24 lines
584 B
Go
24 lines
584 B
Go
package argparser
|
|
|
|
import (
|
|
"testing"
|
|
"gitea.kevinnlsamuel.com/kevinnls/qc/internal/testing/assert"
|
|
)
|
|
|
|
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.Equal(t, ctype, "")
|
|
assert.Equal(t, cscope, "")
|
|
wantedMessage := []string{}
|
|
for i := 0; i < len(wantedMessage); i++ {
|
|
if wantedMessage[i] != cmessage[i] {
|
|
t.Errorf("messages do not match")
|
|
}
|
|
}
|
|
assert.Equal(t, shouldCommit, false)
|
|
assert.Equal(t, shouldStage, false)
|
|
})
|
|
}
|