| 1 | package main |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestDesktopManifestArchitectureDownloads(t *testing.T) { |
| 6 | t.Run("historical two-download manifests remain upgradeable", func(t *testing.T) { |
| 7 | stable := validDesktopManifest(t, "stable", "v1.17.21") |
| 8 | delete(stable.Downloads, "Reasonix-darwin-arm64.dmg") |
| 9 | delete(stable.Downloads, "Reasonix-darwin-amd64.dmg") |
| 10 | if err := validateDesktopManifest("stable", &stable); err != nil { |
| 11 | t.Fatalf("historical Stable manifest: %v", err) |
| 12 | } |
| 13 | }) |
| 14 | t.Run("partial architecture DMGs fail closed", func(t *testing.T) { |
| 15 | manifest := validDesktopManifest(t, "stable", "v1.39.0") |
| 16 | delete(manifest.Downloads, "Reasonix-darwin-amd64.dmg") |
| 17 | if err := validateDesktopManifest("stable", &manifest); err == nil { |
| 18 | t.Fatal("manifest with one architecture DMG passed validation") |
| 19 | } |
| 20 | }) |
| 21 | } |
| 22 |