Files
2026-09-15 13:11:20 +01:00

82 lines
1.5 KiB
Go

package config
import (
"slices"
"testing"
)
func TestVersion(t *testing.T) {
if Version == "" {
t.Error("Version is empty")
}
}
func TestDefaultIgnores(t *testing.T) {
tests := []struct {
name string
want string
}{
{"git", ".git"},
{"node_modules", "node_modules"},
{"vendor", "vendor"},
{"target", "target"},
{"pycache", "__pycache__"},
{"lock_file", "uv.lock"},
{"cargo_lock", "Cargo.lock"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if !slices.Contains(DefaultIgnores, tt.want) {
t.Errorf("DefaultIgnores does not contain %q", tt.want)
}
})
}
}
func TestDefaultExts(t *testing.T) {
tests := []struct {
name string
want string
}{
{"jpg", ".jpg"},
{"png", ".png"},
{"mp4", ".mp4"},
{"zip", ".zip"},
{"exe", ".exe"},
{"pdf", ".pdf"},
{"pem", ".pem"},
{"db", ".db"},
{"jar", ".jar"},
{"pyc", ".pyc"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if !slices.Contains(DefaultExts, tt.want) {
t.Errorf("DefaultExts does not contain %q", tt.want)
}
})
}
}
func TestFrontendExts(t *testing.T) {
tests := []struct {
name string
want string
}{
{"html", ".html"},
{"css", ".css"},
{"js", ".js"},
{"ts", ".ts"},
{"vue", ".vue"},
{"svelte", ".svelte"},
{"gohtml", ".gohtml"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if !slices.Contains(FrontendExts, tt.want) {
t.Errorf("FrontendExts does not contain %q", tt.want)
}
})
}
}