mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-27 01:33:39 +02:00
test coverage
This commit is contained in:
parent
8915f8bbf6
commit
624948faa6
@ -35,6 +35,31 @@ func TestNameFor(t *testing.T) {
|
||||
assert.Equal("test_Darwin_x86_64_v1.2.3_1.2.3", name)
|
||||
}
|
||||
|
||||
func TestNameForBuild(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
var ctx = &context.Context{
|
||||
Config: config.Project{
|
||||
Archive: config.Archive{
|
||||
NameTemplate: "{{.Binary}}_{{.Os}}_{{.Arch}}_{{.Tag}}_{{.Version}}",
|
||||
Replacements: map[string]string{
|
||||
"darwin": "Darwin",
|
||||
"amd64": "x86_64",
|
||||
},
|
||||
},
|
||||
ProjectName: "test",
|
||||
},
|
||||
Version: "1.2.3",
|
||||
Git: context.GitInfo{
|
||||
CurrentTag: "v1.2.3",
|
||||
},
|
||||
}
|
||||
|
||||
name, err := ForBuild(ctx, config.Build{Binary: "foo"}, "darwin", "amd64", "")
|
||||
assert.NoError(err)
|
||||
assert.Equal("foo_Darwin_x86_64_v1.2.3_1.2.3", name)
|
||||
}
|
||||
|
||||
func TestInvalidNameTemplate(t *testing.T) {
|
||||
var assert = assert.New(t)
|
||||
var ctx = &context.Context{
|
||||
|
Loading…
Reference in New Issue
Block a user