1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-31 01:53:50 +02:00

fix(nix): missing artifact type stringer

This commit is contained in:
Carlos Alexandro Becker 2023-06-25 05:42:49 +00:00
parent 72119e4d83
commit cc570c3ba4
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import (
// Type defines the type of an artifact.
type Type int
// If you add more types, update TestArtifactTypeStringer!
const (
// UploadableArchive a tar.gz/zip archive to be uploaded.
UploadableArchive Type = iota + 1
@ -134,6 +135,8 @@ func (t Type) String() string {
return "C Shared Library"
case WingetInstaller, WingetDefaultLocale, WingetVersion:
return "Winget Manifest"
case Nixpkg:
return "Nixpkg"
default:
return "unknown"
}

View File

@ -926,3 +926,11 @@ func TestArtifactStringer(t *testing.T) {
Name: "foobar",
}.String())
}
func TestArtifactTypeStringer(t *testing.T) {
for i := 1; i <= 29; i++ {
t.Run(fmt.Sprintf("type-%d-%s", i, Type(i).String()), func(t *testing.T) {
require.NotEqual(t, "unknown", Type(i).String())
})
}
}