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

Function TestCoversPath

server/common/check_test.go:9–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestCoversPath(t *testing.T) {
10 tests := []struct {
11 name string
12 metaPath string
13 reqPath string
14 applySub bool
15 want bool
16 }{
17 {
18 name: "exact path match with applySub=false",
19 metaPath: "/folder",
20 reqPath: "/folder",
21 applySub: false,
22 want: true,
23 },
24 {
25 name: "exact path match with applySub=true",
26 metaPath: "/folder",
27 reqPath: "/folder",
28 applySub: true,
29 want: true,
30 },
31 {
32 name: "sub path with applySub=true",
33 metaPath: "/folder",
34 reqPath: "/folder/subfolder",
35 applySub: true,
36 want: true,
37 },
38 {
39 name: "sub path with applySub=false",
40 metaPath: "/folder",
41 reqPath: "/folder/subfolder",
42 applySub: false,
43 want: false,
44 },
45 {
46 name: "non-sub path with applySub=true",
47 metaPath: "/folder",
48 reqPath: "/other",
49 applySub: true,
50 want: false,
51 },
52 {
53 name: "non-sub path with applySub=false",
54 metaPath: "/folder",
55 reqPath: "/other",
56 applySub: false,
57 want: false,
58 },
59 {
60 name: "root path covers all with applySub=true",
61 metaPath: "/",
62 reqPath: "/any/deep/path",
63 applySub: true,
64 want: true,
65 },
66 {

Callers

nothing calls this directly

Calls 2

MetaCoversPathFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected