Add TestExpandPath
All checks were successful
/ check (push) Successful in 15s

This commit is contained in:
Oliver Davies 2025-07-31 23:58:18 +01:00
parent 9755abdfd3
commit 9ec56012c2

View file

@ -0,0 +1,26 @@
package utils_test
import (
"os"
"path/filepath"
"testing"
"git-repo-updater/internal/utils"
)
func TestExpandPath(t *testing.T) {
home, _ := os.UserHomeDir()
input := "~/Code/my-repo"
expected := filepath.Join(home, "Code/my-repo")
result, err := utils.ExpandPath(input)
if err != nil {
t.Errorf("ExpandPath(%q) returned error: %v", input, err)
}
if result != expected {
t.Errorf("ExpandPath(%q) = %q; want %q", input, result, expected)
}
}