createProjectDir creates a temp directory with a .taskmd.yaml file inside. Returns the symlink-resolved path for reliable comparisons on macOS.
(t *testing.T)
| 19 | // createProjectDir creates a temp directory with a .taskmd.yaml file inside. |
| 20 | // Returns the symlink-resolved path for reliable comparisons on macOS. |
| 21 | func createProjectDir(t *testing.T) string { |
| 22 | t.Helper() |
| 23 | dir := t.TempDir() |
| 24 | // Resolve symlinks (e.g. /var -> /private/var on macOS) |
| 25 | resolved, err := filepath.EvalSymlinks(dir) |
| 26 | if err != nil { |
| 27 | t.Fatalf("failed to resolve symlinks: %v", err) |
| 28 | } |
| 29 | if err := os.WriteFile(filepath.Join(resolved, configFilename), []byte("dir: .\n"), 0644); err != nil { |
| 30 | t.Fatalf("failed to create %s: %v", configFilename, err) |
| 31 | } |
| 32 | return resolved |
| 33 | } |
| 34 | |
| 35 | func TestProjectRegister_CWD(t *testing.T) { |
| 36 | resetProjectRegistryFlags() |
no outgoing calls
no test coverage detected