diff options
| author | Raúl Benencia <id@rbenencia.name> | 2026-06-05 15:41:09 -0300 |
|---|---|---|
| committer | Raul Benencia <46945030+raul-te@users.noreply.github.com> | 2026-06-05 16:29:33 -0300 |
| commit | 78cfb30c7903c70f423256f55d7133609f0c2c8e (patch) | |
| tree | 688ccd0e070f0bef5b0b9490ac0d75e823d02dac /internal/environment/flags_test.go | |
| parent | 3c11829324a7151212d17bacc5d403e6d3a2204a (diff) | |
Return flag validation errors
Diffstat (limited to 'internal/environment/flags_test.go')
| -rw-r--r-- | internal/environment/flags_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
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() |
