Create update_test.go

This commit is contained in:
Oliver Davies 2025-07-31 23:33:30 +01:00
parent 74f2ebfa57
commit 31d313c6a9

View file

@ -0,0 +1,26 @@
package repositories_test
import (
"slices"
"testing"
"git-repo-updater/internal/utils"
)
func TestIsIgnoredRepo(t *testing.T) {
ignored := []string{"~/Code/skip-me"}
repoPath := "/home/opdavies/Code/skip-me"
var expandedIgnored []string
for _, path := range ignored {
e, _ := utils.ExpandPath(path)
expandedIgnored = append(expandedIgnored, e)
}
isIgnored := slices.Contains(expandedIgnored, repoPath)
if !isIgnored {
t.Errorf("expected repo %s to be ignored, but it was not", repoPath)
}
}