mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-03 13:11:48 +02:00
added more build pipe test
This commit is contained in:
parent
26727a6f7f
commit
7eb383135e
@ -9,11 +9,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestExtWindows(t *testing.T) {
|
func TestExtWindows(t *testing.T) {
|
||||||
assert.Equal(t, extFor("windows"), ".exe")
|
assert.Equal(t, ".exe", extFor("windows"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExtOthers(t *testing.T) {
|
func TestExtOthers(t *testing.T) {
|
||||||
assert.Empty(t, extFor("linux"))
|
assert.Empty(t, "", extFor("linux"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNameFor(t *testing.T) {
|
func TestNameFor(t *testing.T) {
|
||||||
@ -42,3 +42,25 @@ func TestNameFor(t *testing.T) {
|
|||||||
assert.NoError(err)
|
assert.NoError(err)
|
||||||
assert.Equal("test_Darwin_x86_64_v1.2.3", name)
|
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)
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user