Fix Windows test failures: path handling and bd binary references

- Fix TestFindDatabasePathEnvVar to expect canonicalized absolute paths
- Add getBDCommand() helper for platform-specific bd executable paths
- Update beads_hash_multiclone_test.go to use platform-specific bd paths
- Fix cleanupWALFiles linting error (removed unused error return)
This commit is contained in:
Steve Yegge
2025-11-02 09:49:39 -08:00
parent 361f46346e
commit 9f9b8bbdc2
4 changed files with 32 additions and 21 deletions

View File

@@ -17,13 +17,15 @@ func TestFindDatabasePathEnvVar(t *testing.T) {
}
}()
// Set env var to a test path
testPath := "/test/path/test.db"
// Set env var to a test path (platform-agnostic)
testPath := filepath.Join("test", "path", "test.db")
_ = os.Setenv("BEADS_DB", testPath)
result := FindDatabasePath()
if result != testPath {
t.Errorf("Expected '%s', got '%s'", testPath, result)
// FindDatabasePath canonicalizes to absolute path
expectedPath, _ := filepath.Abs(testPath)
if result != expectedPath {
t.Errorf("Expected '%s', got '%s'", expectedPath, result)
}
}