MCPcopy Index your code
hub / github.com/google/go-github / mockSigner

Function mockSigner

github/git_commits_test.go:20–31  ·  view source on GitHub ↗
(t *testing.T, signature string, emitErr error, wantMessage string)

Source from the content-addressed store, hash-verified

18)
19
20func mockSigner(t *testing.T, signature string, emitErr error, wantMessage string) MessageSignerFunc {
21 return func(w io.Writer, r io.Reader) error {
22 t.Helper()
23 message, err := io.ReadAll(r)
24 assertNilError(t, err)
25 if wantMessage != "" && string(message) != wantMessage {
26 t.Errorf("MessageSignerFunc got %q, want %q", string(message), wantMessage)
27 }
28 assertWrite(t, w, []byte(signature))
29 return emitErr
30 }
31}
32
33func uncalledSigner(t *testing.T) MessageSignerFunc {
34 return func(io.Writer, io.Reader) error {

Calls 2

assertWriteFunction · 0.85
assertNilErrorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…