wails-release/internal/archive/archive_test.go
Leon Mika 1acf07af16 Add ditto archive helper
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 10:09:40 +10:00

25 lines
645 B
Go

package archive_test
import (
"context"
"reflect"
"testing"
"github.com/leonmika/wails-release/internal/archive"
"github.com/leonmika/wails-release/internal/runner"
)
func TestZipApp_BuildsCorrectDittoArgs(t *testing.T) {
f := &runner.Fake{}
f.On("ditto", nil).Return(nil, nil)
err := archive.ZipApp(context.Background(), f, "/build/MyApp.app", "/dist/MyApp-1.2.3.app.zip")
if err != nil {
t.Fatalf("unexpected: %v", err)
}
want := []string{"-c", "-k", "--keepParent", "/build/MyApp.app", "/dist/MyApp-1.2.3.app.zip"}
if !reflect.DeepEqual(f.Calls[0].Args, want) {
t.Fatalf("args got %v want %v", f.Calls[0].Args, want)
}
}