MCPcopy
hub / github.com/syncthing/syncthing / TestCreate

Function TestCreate

lib/fs/basicfs_test.go:165–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestCreate(t *testing.T) {
166 fs, dir := setup(t)
167 path := filepath.Join(dir, "file")
168
169 if _, err := os.Stat(path); err == nil {
170 t.Errorf("exists?")
171 }
172
173 fd, err := fs.Create("file")
174 if err != nil {
175 t.Error(err)
176 }
177 fd.Close()
178
179 if _, err := os.Stat(path); err != nil {
180 t.Error(err)
181 }
182}
183
184func TestCreateSymlink(t *testing.T) {
185 if build.IsWindows {

Callers

nothing calls this directly

Calls 5

setupFunction · 0.85
StatMethod · 0.65
CreateMethod · 0.65
ErrorMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected