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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user