MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / TestSymlinkInstall

Function TestSymlinkInstall

internal/instructions/install_test.go:23–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestSymlinkInstall(t *testing.T) {
24 if !symlinksWork(t) {
25 t.Skip("symlinks unavailable on this platform/session")
26 }
27 ctx := context.Background()
28 s := newTestStore(t)
29 in, err := s.Create(ctx, "Sym", "", "body\n")
30 if err != nil {
31 t.Fatalf("Create: %v", err)
32 }
33 ins, err := s.Install(ctx, in.ID, "claude", "user", "")
34 if err != nil {
35 t.Fatalf("Install: %v", err)
36 }
37 if ins.LinkKind != "symlink" {
38 t.Fatalf("expected symlink, got %s", ins.LinkKind)
39 }
40 resolved, err := os.Readlink(ins.TargetPath)
41 if err != nil {
42 t.Fatalf("Readlink: %v", err)
43 }
44 if filepath.Clean(resolved) != filepath.Clean(managedFilePath("Sym")) {
45 t.Fatalf("symlink points at %s, want %s", resolved, managedFilePath("Sym"))
46 }
47}
48
49func TestCopyFallback(t *testing.T) {
50 ctx := context.Background()

Callers

nothing calls this directly

Calls 5

symlinksWorkFunction · 0.85
newTestStoreFunction · 0.85
managedFilePathFunction · 0.85
CreateMethod · 0.80
InstallMethod · 0.45

Tested by

no test coverage detected