MCPcopy Create free account
hub / github.com/docker/docker-language-server / TestReadDocument

Function TestReadDocument

internal/pkg/document/manager_test.go:17–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestReadDocument(t *testing.T) {
18 testFile := filepath.Join(os.TempDir(), "TestReadDocument")
19 err := os.WriteFile(testFile, []byte("hello world"), 0644)
20 require.NoError(t, err)
21
22 contents, err := ReadDocument(uri.URI(fmt.Sprintf("file:///%v", strings.TrimPrefix(filepath.ToSlash(testFile), "/"))))
23 require.NoError(t, err)
24 require.Equal(t, "hello world", string(contents))
25}
26
27func TestURIfilename(t *testing.T) {
28 file := filepath.Join(os.TempDir(), "mod")

Callers

nothing calls this directly

Calls 2

ReadDocumentFunction · 0.85
URIMethod · 0.65

Tested by

no test coverage detected