1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

added more build pipe test

This commit is contained in:
Carlos Alexandro Becker 2017-04-22 10:34:12 -03:00
parent 26727a6f7f
commit 7eb383135e
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -9,11 +9,11 @@ import (
)
func TestExtWindows(t *testing.T) {
assert.Equal(t, extFor("windows"), ".exe")
assert.Equal(t, ".exe", extFor("windows"))
}
func TestExtOthers(t *testing.T) {
assert.Empty(t, extFor("linux"))
assert.Empty(t, "", extFor("linux"))
}
func TestNameFor(t *testing.T) {
@ -42,3 +42,25 @@ func TestNameFor(t *testing.T) {
assert.NoError(err)
assert.Equal("test_Darwin_x86_64_v1.2.3", name)
}
func TestInvalidNameTemplate(t *testing.T) {
assert := assert.New(t)
var config = config.Project{
Archive: config.Archive{
NameTemplate: "{{.Binaryyy}}_{{.Os}}_{{.Arch}}_{{.Version}}",
},
Build: config.Build{
Binary: "test",
},
}
var ctx = &context.Context{
Config: config,
Git: context.GitInfo{
CurrentTag: "v1.2.3",
},
}
_, err := nameFor(ctx, "darwin", "amd64")
assert.Error(err)
}