MCPcopy Create free account
hub / github.com/easyp-tech/server / TestCommitUUIDEmpty

Function TestCommitUUIDEmpty

internal/connect/commits_helpers_test.go:91–95  ·  view source on GitHub ↗

TestCommitUUIDEmpty guards the empty-input branch. The buf client never sends an empty commit id, but the proxy might compute one when an upstream returns an empty SHA. Returning "" (rather than a zero-UUID) keeps the empty case distinguishable in logs and avoids poisoning the commitMap with a junk

(t *testing.T)

Source from the content-addressed store, hash-verified

89// zero-UUID) keeps the empty case distinguishable in logs and avoids
90// poisoning the commitMap with a junk key.
91func TestCommitUUIDEmpty(t *testing.T) {
92 if got := commitUUID(""); got != "" {
93 t.Fatalf("commitUUID(\"\") = %q, want \"\"", got)
94 }
95}
96
97// TestCommitUUIDNoLeadingZeroStrip guards against a "feature" where
98// hex.EncodeToString might be replaced with a printer that drops

Callers

nothing calls this directly

Calls 1

commitUUIDFunction · 0.85

Tested by

no test coverage detected