Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In utils/ReleaseNameFromVersion could benifit from extended unit-tests #773

Open
s3rj1k opened this issue Dec 10, 2024 · 0 comments
Open

Comments

@s3rj1k
Copy link
Contributor

s3rj1k commented Dec 10, 2024

In utils/ReleaseNameFromVersion could benifit from extended unit-tests.

RN

func TestReleaseNameFromVersion(t *testing.T) {
	for _, tc := range []struct {
		version      string
		expectedName string
	}{
		{version: "v0.0.1", expectedName: "hmc-0-0-1"},
		{version: "v0.0.1-rc", expectedName: "hmc-0-0-1-rc"},
		{version: "0.0.1", expectedName: "hmc-0-0-1"},
	} {
		t.Run(tc.version, func(t *testing.T) {
			actual := ReleaseNameFromVersion(tc.version)
			if actual != tc.expectedName {
				t.Errorf("expected name %s, got %s", tc.expectedName, actual)
			}
		})
	}
}

Tests input does not cover semver in fully nor version gets validated for being valid semver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants