From 78cfb30c7903c70f423256f55d7133609f0c2c8e Mon Sep 17 00:00:00 2001 From: Raúl Benencia Date: Fri, 5 Jun 2026 15:41:09 -0300 Subject: Return flag validation errors --- internal/environment/flags_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal/environment/flags_test.go') diff --git a/internal/environment/flags_test.go b/internal/environment/flags_test.go index 0cab282..2c2750d 100644 --- a/internal/environment/flags_test.go +++ b/internal/environment/flags_test.go @@ -122,6 +122,20 @@ func TestSetFlagsReturnsConfigErrors(t *testing.T) { } } +func TestValidateFlagsReturnsError(t *testing.T) { + env := defaultEnvironment() + env.DataDir = "data" + env.StaticDir = "web" + if err := env.validateFlags(); err != nil { + t.Fatal(err) + } + + env.StaticDir = "" + if err := env.validateFlags(); err == nil { + t.Fatal("Expected error") + } +} + func writeConfig(t *testing.T, name string, contents string) string { t.Helper() -- cgit v1.2.3