K4b reserved-other-bytes: RunReserved's held-under-another-digest row is answered other-bytes, nothing stored

Builds: design 47 H2 H-A-738 (1), H-A-729
This commit is contained in:
2026-11-25 17:34:12 +01:00
parent c9de0c6245
commit c7c65556db
@@ -151,7 +151,7 @@ func RunReserved(t *testing.T, fresh func(t *testing.T) ReservedBed) {
}{
{name: "reserved, no digest yet: published", reserve: NoDigestYet, ok: true},
{name: "reserved with the digest: published", reserve: SameDigest, ok: true},
{name: "reserved with no digest yet, the version held under another digest: refused, nothing published", reserve: NoDigestYet, held: true, words: "is published with"},
{name: "reserved with no digest yet, the version held under another digest: answered other-bytes, nothing stored", reserve: NoDigestYet, held: true},
{name: "reserved for another digest: refused, naming the reservation", reserve: OtherDigest, words: "did not reserve"},
{name: "nothing reserved: refused", words: "did not"},
} {
@@ -165,9 +165,10 @@ func RunReserved(t *testing.T, fresh func(t *testing.T) ReservedBed) {
}
o := b.PublishWhole()
if c.held {
// Refused whether it ends with an error or only with the event refused, and never said published.
if o.Event != "refused" || !strings.Contains(o.Reason, c.words) {
t.Fatalf("answered %+v; want refused with %q in its reason, and nothing published", o, c.words)
// A version held under another digest is answered other-bytes, the held digest named: no error, never said
// published and nothing stored; the reader compares its fingerprint (design 47 H2 H-A-729, H-A-738 (1)).
if o.Err != nil || o.Other == nil || o.Other.Digest == "" || o.Event == "published" {
t.Fatalf("answered %+v; want no error and other-bytes naming the held digest, and nothing published", o)
}
return
}