diff --git a/pipeline/archive/archive_test.go b/pipeline/archive/archive_test.go index 494619742..3679e0d2c 100644 --- a/pipeline/archive/archive_test.go +++ b/pipeline/archive/archive_test.go @@ -63,3 +63,22 @@ func TestRunPipe(t *testing.T) { assert.Error(Pipe{}.Run(ctx)) }) } + +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", formatFor(ctx, "windowsamd64")) + assert.Equal("tar.gz", formatFor(ctx, "linux386")) +}