Files
yay/pkg/text/color_test.go
T
Jo 15057c8dab misc(ci): add modernize linter and update versioning (#2870)
* add modernize linter

* lint unused

* update imports

* ignore agent info
2026-06-17 21:09:53 +02:00

25 lines
602 B
Go

//go:build !integration
package text
import (
"testing"
"github.com/stretchr/testify/require"
)
// TestColorHash is intentionally not parallel because it mutates the
// package-level UseColor variable. No other parallel test in this
// package reads UseColor, so sequential execution is sufficient.
func TestColorHash(t *testing.T) {
original := UseColor
defer func() { UseColor = original }()
UseColor = true
require.Equal(t, ColorHash("core"), ColorHash("core"))
require.NotEqual(t, ColorHash("core"), ColorHash("extra"))
UseColor = false
require.Equal(t, "core", ColorHash("core"))
}