mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-03 15:57:24 +00:00
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%.
24 lines
597 B
Go
24 lines
597 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestRunEnvRequiresBin(t *testing.T) {
|
|
if code := runEnv(nil); code != 1 {
|
|
t.Errorf("runEnv(nil) = %d, want 1", code)
|
|
}
|
|
}
|
|
|
|
func TestRunEnvRejectsMissingBinDir(t *testing.T) {
|
|
if code := runEnv([]string{"--bin", "/nonexistent/path/for/vintner/tests"}); code != 1 {
|
|
t.Errorf("runEnv with a nonexistent --bin = %d, want 1", code)
|
|
}
|
|
}
|
|
|
|
func TestToUnixPathList(t *testing.T) {
|
|
got := toUnixPathList(`z:\vc\include;z:\kits\10\include`)
|
|
want := "/vc/include;/kits/10/include"
|
|
if got != want {
|
|
t.Errorf("toUnixPathList(...) = %q, want %q", got, want)
|
|
}
|
|
}
|