Artifact f233528f80c084a0734ed83f6b12dfab10e7236e17e1d17875cca3f6d01ff1ac:
- File
conformance/repostate_eventtags_test.go
— part of check-in
[245a0ed306]
at
2026-10-20 02:08:49
on branch feat/submanifest-reader
— conformance: re-pin the three drafts to their -00 names
zit check-in 68a3f76cb7 renames the artifact-format, repo-state and sync-protocol drafts from -01 to -00 in their headers, cross-references and reference entries, and retitles each Changes appendix "Changes in This Revision". No normative text changed and no section number moved.
The pinned copies take zit's file names, the requirement tables pin the new hashes, and the comments, tests and docs that cited the -01 drafts cite the -00 ones. The refresh script copies every draft under its own name. The sparse-cone copy is re-pinned to d497c2432f, whose text is unchanged. Coverage counts are identical before and after. (user: [email protected], size: 2973) [annotate] [blame] [check-ins using] [more...]
package conformance import "testing" // The bgcolor, user and comment tags override a check-in's derived event row // (bgcolor, euser, ecomment), whatever the tag's type, and a cancel clears // the column. fossil(1) does this in tag_insert when the tag arrives after // the check-in and in manifest_crosslink when it arrived first, while the // check-in was still a phantom. draft-fossil-repo-state-00 does not describe // these columns, so the cases name no requirement and stay out of the // coverage audit, with fossil(1) as their reference. // eventTagCase compares the bgcolor, euser and ecomment of the check-ins. func eventTagCase(id string, arts []rsArt, want []string, ignoring ...string) rsCase { return rsCase{ Case: Case{ID: id}, arts: arts, tables: []string{"eventcols"}, want: rows("eventcols", want...), ignoring: ignoring, rebuild: true, each: true, } } func eventTagCases() []rsCase { base := chain()[:2] none := "NULL NULL NULL" return []rsCase{ eventTagCase("repostate.fossil.bgcolor-singleton", with(base, control("t", 9, "+bgcolor {c2} red")), []string{"c1 " + none, "c2 'red' NULL NULL"}, "-eventcols: c2 'red' NULL NULL", "+eventcols: c2 "+none), eventTagCase("repostate.fossil.bgcolor-propagating", with(chain(), control("t", 9, "*bgcolor {c2} red")), []string{"c1 " + none, "c2 'red' NULL NULL", "c3 'red' NULL NULL", "c4 'red' NULL NULL"}, "-eventcols: c3 'red' NULL NULL", "+eventcols: c3 "+none), eventTagCase("repostate.fossil.bgcolor-cancel", with(chain()[:3], control("t1", 8, "*bgcolor {c2} red"), control("t2", 9, "-bgcolor {c2}")), []string{"c1 " + none, "c2 " + none, "c3 " + none}, "-eventcols: c2 "+none, "+eventcols: c2 'red' NULL NULL"), eventTagCase("repostate.fossil.user-tag", with(base, control("t", 9, "+user {c2} bob")), []string{"c1 " + none, "c2 NULL 'bob' NULL"}, "-eventcols: c2 NULL 'bob' NULL", "+eventcols: c2 "+none), eventTagCase("repostate.fossil.comment-tag", with(base, control("t", 9, "+comment {c2} reworded")), []string{"c1 " + none, "c2 NULL NULL 'reworded'"}, "-eventcols: c2 NULL NULL 'reworded'", "+eventcols: c2 "+none), } } // cancelValueNotCached cancels bgcolor with a value: the row keeps it, but // the event table takes the cancel as null (Section 5.3, step 3). Unlike the // cases above it names a requirement, so it runs in TestRepoState. func cancelValueNotCached() rsCase { none := "NULL NULL NULL" c := eventTagCase("repostate.5.3.cancel-value-not-cached", with(chain()[:3], control("t1", 8, "*bgcolor {c2} red"), control("t2", 9, "-bgcolor {c2} why")), []string{"c1 " + none, "c2 " + none, "c3 " + none}, "-eventcols: c2 "+none, "+eventcols: c2 'why' NULL NULL") c.Req = "RS-5.3-6" return c } func TestRepoStateEventTags(t *testing.T) { runRepoStateCases(t, eventTagCases()) } func TestRepoStateEventTagsReasons(t *testing.T) { checkRepoStateReasons(t, eventTagCases()) }