MCPcopy Create free account
hub / github.com/driangle/taskmd / TestResolveRelativeToConfig_DotPath

Function TestResolveRelativeToConfig_DotPath

apps/cli/internal/cli/root_test.go:52–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestResolveRelativeToConfig_DotPath(t *testing.T) {
53 // "." should resolve to the config file's directory.
54 tmpDir := t.TempDir()
55 configPath := filepath.Join(tmpDir, ".taskmd.yaml")
56 if err := os.WriteFile(configPath, []byte("task-dir: .\n"), 0o644); err != nil {
57 t.Fatalf("failed to write config: %v", err)
58 }
59
60 viper.Reset()
61 defer viper.Reset()
62 viper.SetConfigFile(configPath)
63 if err := viper.ReadInConfig(); err != nil {
64 t.Fatalf("failed to read config: %v", err)
65 }
66
67 result := resolveRelativeToConfig(".")
68 expected := tmpDir
69 if result != expected {
70 t.Errorf("expected %q, got %q", expected, result)
71 }
72}

Callers

nothing calls this directly

Calls 1

resolveRelativeToConfigFunction · 0.85

Tested by

no test coverage detected