MCPcopy Create free account
hub / github.com/tailscale/tailscale / fileHasContents

Function fileHasContents

feature/taildrop/peerapi_test.go:122–139  ·  view source on GitHub ↗
(name string, want string)

Source from the content-addressed store, hash-verified

120}
121
122func fileHasContents(name string, want string) check {
123 return func(t *testing.T, e *peerAPITestEnv) {
124 fsImpl, ok := e.taildrop.opts.fileOps.(*fsFileOps)
125 if !ok {
126 t.Skip("fileHasContents only supported on fsFileOps backend")
127 return
128 }
129 path := filepath.Join(fsImpl.rootDir, name)
130 got, err := os.ReadFile(path)
131 if err != nil {
132 t.Errorf("fileHasContents: %v", err)
133 return
134 }
135 if string(got) != want {
136 t.Errorf("file contents = %q; want %q", got, want)
137 }
138 }
139}
140
141func hexAll(v string) string {
142 var sb strings.Builder

Callers 1

TestHandlePeerAPIFunction · 0.85

Calls 3

SkipMethod · 0.65
ReadFileMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…