MCPcopy
hub / github.com/syncthing/syncthing / TestIssue3164

Function TestIssue3164

lib/model/folder_sendrecv_test.go:544–570  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

542}
543
544func TestIssue3164(t *testing.T) {
545 _, f := setupSendReceiveFolder(t)
546 ffs := f.Filesystem()
547
548 ignDir := filepath.Join("issue3164", "oktodelete")
549 subDir := filepath.Join(ignDir, "foobar")
550 must(t, ffs.MkdirAll(subDir, 0o777))
551 must(t, fs.WriteFile(ffs, filepath.Join(subDir, "file"), []byte("Hello"), 0o644))
552 must(t, fs.WriteFile(ffs, filepath.Join(ignDir, "file"), []byte("Hello"), 0o644))
553 file := protocol.FileInfo{
554 Name: "issue3164",
555 }
556
557 must(t, f.scanSubdirs(t.Context(), nil))
558
559 matcher := ignore.New(ffs)
560 must(t, matcher.Parse(bytes.NewBufferString("(?d)oktodelete"), ""))
561 f.ignores = matcher
562
563 dbUpdateChan := make(chan dbUpdateJob, 1)
564
565 f.deleteDir(file, dbUpdateChan, make(chan string))
566
567 if _, err := ffs.Stat("issue3164"); !fs.IsNotExist(err) {
568 t.Fatal(err)
569 }
570}
571
572func TestDiff(t *testing.T) {
573 for i, test := range diffTestData {

Callers

nothing calls this directly

Calls 12

WriteFileFunction · 0.92
NewFunction · 0.92
IsNotExistFunction · 0.92
setupSendReceiveFolderFunction · 0.85
mustFunction · 0.85
FilesystemMethod · 0.80
scanSubdirsMethod · 0.80
ParseMethod · 0.80
deleteDirMethod · 0.80
FatalMethod · 0.80
MkdirAllMethod · 0.65
StatMethod · 0.65

Tested by

no test coverage detected