MCPcopy Index your code
hub / github.com/coder/coder / TestIsAbsolutePath

Function TestIsAbsolutePath

coderd/x/chatd/chattool/planpath_internal_test.go:9–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestIsAbsolutePath(t *testing.T) {
10 t.Parallel()
11
12 tests := []struct {
13 path string
14 want bool
15 }{
16 {"/home/coder/PLAN.md", true},
17 {"/workspace/project/plan.md", true},
18 {"plan.md", false},
19 {"./plan.md", false},
20 {"../plan.md", false},
21 {"", false},
22 }
23
24 for _, tt := range tests {
25 t.Run(tt.path, func(t *testing.T) {
26 t.Parallel()
27 require.Equal(t, tt.want, isAbsolutePath(tt.path))
28 })
29 }
30}
31
32func TestLooksLikePlanFileName(t *testing.T) {
33 t.Parallel()

Callers

nothing calls this directly

Calls 3

isAbsolutePathFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected