Files
Cheviiot fc20b2fb15 Add test coverage for cmd/vintner and internal/i18n
Both were at 0% coverage. Focused on what's safely testable without
touching the network or filesystem: flag validation (--architecture/
--host-arch, the same guard added in the stability pass), subcommand
dispatch and aliases, help/usage error paths, and - for i18n - full
language-detection table coverage plus a completeness check that
every catalog key has both an EN and RU entry (an English-only or
Russian-only entry would silently degrade rather than fail loudly,
so this is worth locking in). cmd/vintner: 0% -> 28.8%, i18n: 0% ->
94.1%.
2026-07-25 10:41:48 +10:00

23 lines
437 B
Go

package main
import (
"os"
"path/filepath"
"testing"
)
func TestDefaultToolchainDir(t *testing.T) {
home, err := os.UserHomeDir()
if err != nil {
t.Skipf("no home directory available: %v", err)
}
got, err := defaultToolchainDir()
if err != nil {
t.Fatalf("defaultToolchainDir() error: %v", err)
}
want := filepath.Join(home, ".vintner")
if got != want {
t.Errorf("defaultToolchainDir() = %q, want %q", got, want)
}
}