mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-26 04:22:05 +02:00
29 lines
563 B
Go
29 lines
563 B
Go
package archiveformat
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/goreleaser/goreleaser/config"
|
|
"github.com/goreleaser/goreleaser/context"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFormatFor(t *testing.T) {
|
|
var assert = assert.New(t)
|
|
var ctx = &context.Context{
|
|
Config: config.Project{
|
|
Archive: config.Archive{
|
|
Format: "tar.gz",
|
|
FormatOverrides: []config.FormatOverride{
|
|
{
|
|
Goos: "windows",
|
|
Format: "zip",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
assert.Equal("zip", For(ctx, "windowsamd64"))
|
|
assert.Equal("tar.gz", For(ctx, "linux386"))
|
|
}
|