30 lines
867 B
Go
30 lines
867 B
Go
package publish
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"gitea.maximumdirect.net/eric/distributor/internal/bundle"
|
|
"gitea.maximumdirect.net/eric/distributor/internal/config"
|
|
)
|
|
|
|
func TestPlanSourceOutputsRejectsCollision(t *testing.T) {
|
|
_, err := PlanSourceOutputs(Request{
|
|
SourceBundle: bundle.Bundle{
|
|
Manifest: bundle.Manifest{
|
|
SchemaVersion: 1,
|
|
ID: "bundle",
|
|
Created: time.Date(2026, 5, 30, 11, 10, 0, 0, time.UTC),
|
|
Files: []bundle.ManifestFile{
|
|
{Path: "report.md", SHA256: "sha256:1111111111111111111111111111111111111111111111111111111111111111", Size: 1},
|
|
{Path: "report.md", SHA256: "sha256:2222222222222222222222222222222222222222222222222222222222222222", Size: 1},
|
|
},
|
|
},
|
|
},
|
|
Publish: config.PublishPolicy{Source: true},
|
|
})
|
|
if err == nil {
|
|
t.Fatal("PlanSourceOutputs() error = nil, want collision")
|
|
}
|
|
}
|