mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-03 15:57:24 +00:00
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%.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestRunInstallRejectsExtraArgs(t *testing.T) {
|
||||
if code := runInstall([]string{"one", "two"}); code != 1 {
|
||||
t.Errorf("runInstall with two args = %d, want 1", code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunInstallHelp(t *testing.T) {
|
||||
for _, flag := range []string{"-h", "--help"} {
|
||||
if code := runInstall([]string{flag}); code != 1 {
|
||||
t.Errorf("runInstall([%q]) = %d, want 1", flag, code)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user