test: cover normalized no-banner env values

This commit is contained in:
李龙 0668001470 2026-03-12 23:27:29 +08:00
parent 73a1dbc8a6
commit fedfb6d84c

View file

@ -80,9 +80,9 @@ func TestShouldPrintBanner(t *testing.T) {
assert.False(t, shouldPrintBanner([]string{"picoclaw", "agent"}, true)) assert.False(t, shouldPrintBanner([]string{"picoclaw", "agent"}, true))
}) })
t.Run("common truthy env values disable banner", func(t *testing.T) { t.Run("truthy env values disable banner after normalization", func(t *testing.T) {
for _, value := range []string{"true", "yes", "on"} { for _, value := range []string{"true", "yes", "on", " TrUe ", "\tON\n"} {
t.Run(value, func(t *testing.T) { t.Run(fmt.Sprintf("%q", value), func(t *testing.T) {
t.Setenv(noBannerEnv, value) t.Setenv(noBannerEnv, value)
assert.False(t, shouldPrintBanner([]string{"picoclaw", "agent"}, true)) assert.False(t, shouldPrintBanner([]string{"picoclaw", "agent"}, true))
}) })