feat: empty test for argparser; assertion helpers

This commit is contained in:
2024-01-21 10:55:21 +05:30
parent 2e7f59a069
commit 9f6e503379
2 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
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)
})
}