test(config): pin splitCSV whitespace and empty-entry handling

This commit is contained in:
Mathias Bergqvist
2026-05-04 20:25:28 +02:00
parent d399a216c1
commit 87cbce27a1

View File

@@ -36,3 +36,11 @@ func TestLoadFromEnv(t *testing.T) {
assert.Equal(t, []string{"https://claude.ai", "https://api.anthropic.com"}, cfg.OriginAllowlist)
assert.Equal(t, "9000", cfg.Port)
}
func TestLoadCSVTrimsWhitespaceAndDropsEmpty(t *testing.T) {
t.Setenv("GITEA_MCP_ALLOWED_OWNERS", " mathias , , acme ")
cfg, err := config.Load()
require.NoError(t, err)
assert.Equal(t, []string{"mathias", "acme"}, cfg.AllowedOwners)
}