MCPcopy Create free account
hub / github.com/diillson/chatcli / TestLSPRelPath

Function TestLSPRelPath

cli/lsp_tool_adapter_test.go:23–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestLSPRelPath(t *testing.T) {
24 if got := relPath("/ws/proj", "file:///ws/proj/cli/cli.go"); got != "cli/cli.go" {
25 t.Fatalf("in-root path = %q, want workspace-relative", got)
26 }
27 if got := relPath("/ws/proj", "file:///usr/lib/go/src/fmt/print.go"); got != "/usr/lib/go/src/fmt/print.go" {
28 t.Fatalf("out-of-root path = %q, want absolute", got)
29 }
30 if got := relPath("", "file:///a/b.go"); got != "/a/b.go" {
31 t.Fatalf("empty root = %q, want absolute", got)
32 }
33}
34
35func TestLSPFormatLocationsBoundsAndConverts(t *testing.T) {
36 locs := []lsp.Location{

Callers

nothing calls this directly

Calls 1

relPathFunction · 0.85

Tested by

no test coverage detected