Artifact 30fad618a28299a642eca260b00d970a41a897b485202f86c56d9630410f97b9:
- File
internal/xfer/uvname_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: 1378) [annotate] [blame] [check-ins using] [more...]
package xfer import ( "bytes" "testing" ) // TestUVNameFossilized pins the NAME of uvfile, uvigot and uvgimme as // fossilized on the wire (sync-protocol-00 Section 7.3 and Appendix B): a // name with a space goes out escaped and comes back whole. fossil(1) 2.28 // sends the name raw and refuses an escaped one; the draft governs. func TestUVNameFossilized(t *testing.T) { const name = "a b.txt" const hash = "1f09d30c707d53f3d16c530dd73d70a6ce7596a9" for _, tc := range []struct { card Card wire string }{ {&UVFileCard{Name: name, MTime: 1, Hash: "-", Flags: 1}, `uvfile a\sb.txt 1 - 0 1` + "\n"}, {&UVIGotCard{Name: name, MTime: 1, Hash: hash, Size: 2}, `uvigot a\sb.txt 1 ` + hash + " 2\n"}, {&UVGimmeCard{Name: name}, `uvgimme a\sb.txt` + "\n"}, } { var buf bytes.Buffer if err := EncodeCard(&buf, tc.card); err != nil { t.Fatal(err) } if buf.String() != tc.wire { t.Errorf("wire %q, want %q", buf.String(), tc.wire) } msg, err := DecodeUncompressed([]byte(tc.wire)) if err != nil { t.Fatalf("%q: %v", tc.wire, err) } var got string switch c := msg.Cards[0].(type) { case *UVFileCard: got = c.Name case *UVIGotCard: got = c.Name case *UVGimmeCard: got = c.Name default: t.Fatalf("%q decoded as %T", tc.wire, c) } if got != name { t.Errorf("%q: NAME %q, want %q", tc.wire, got, name) } } }