MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / TestIsSystemFile

Function TestIsSystemFile

pkg/utils/file_test.go:7–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestIsSystemFile(t *testing.T) {
8 testCases := []struct {
9 filename string
10 expected bool
11 }{
12 // System files that should be filtered
13 {".DS_Store", true},
14 {"desktop.ini", true},
15 {"Thumbs.db", true},
16 {"._test.txt", true},
17 {"._", true},
18 {"._somefile", true},
19 {"._folder_name", true},
20 {"@eaDir", true},
21
22 // Regular files that should not be filtered
23 {"test.txt", false},
24 {"file.pdf", false},
25 {"document.docx", false},
26 {".gitignore", false},
27 {".env", false},
28 {"_underscore.txt", false},
29 {"normal_file.txt", false},
30 {"", false},
31 {".hidden", false},
32 {"..special", false},
33 }
34
35 for _, tc := range testCases {
36 t.Run(tc.filename, func(t *testing.T) {
37 result := IsSystemFile(tc.filename)
38 if result != tc.expected {
39 t.Errorf("IsSystemFile(%q) = %v, want %v", tc.filename, result, tc.expected)
40 }
41 })
42 }
43}

Callers

nothing calls this directly

Calls 2

IsSystemFileFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected