From ab57089ddd9c87ff70af2f313607fa32935be898 Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Wed, 29 Dec 2021 18:07:52 -0300 Subject: [PATCH] test: test nil version on NextVersion function --- sv/semver_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sv/semver_test.go b/sv/semver_test.go index 27c13e3..b1cfc7e 100644 --- a/sv/semver_test.go +++ b/sv/semver_test.go @@ -17,10 +17,12 @@ func TestSemVerCommitsProcessorImpl_NextVersion(t *testing.T) { wantUpdated bool }{ {"no update", true, version("0.0.0"), []GitCommitLog{}, version("0.0.0"), false}, + {"no update without version", true, nil, []GitCommitLog{}, nil, false}, {"no update on unknown type", true, version("0.0.0"), []GitCommitLog{commitlog("a", map[string]string{})}, version("0.0.0"), false}, {"no update on unmapped known type", false, version("0.0.0"), []GitCommitLog{commitlog("none", map[string]string{})}, version("0.0.0"), false}, {"update patch on unknown type", false, version("0.0.0"), []GitCommitLog{commitlog("a", map[string]string{})}, version("0.0.1"), true}, {"patch update", false, version("0.0.0"), []GitCommitLog{commitlog("patch", map[string]string{})}, version("0.0.1"), true}, + {"patch update without version", false, nil, []GitCommitLog{commitlog("patch", map[string]string{})}, nil, true}, {"minor update", false, version("0.0.0"), []GitCommitLog{commitlog("patch", map[string]string{}), commitlog("minor", map[string]string{})}, version("0.1.0"), true}, {"major update", false, version("0.0.0"), []GitCommitLog{commitlog("patch", map[string]string{}), commitlog("major", map[string]string{})}, version("1.0.0"), true}, {"breaking change update", false, version("0.0.0"), []GitCommitLog{commitlog("patch", map[string]string{}), commitlog("patch", map[string]string{"breaking-change": "break"})}, version("1.0.0"), true},