(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func 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 | } |
nothing calls this directly
no test coverage detected