fix: windows lint and linux ci

Signed-off-by: drew <me@andrinoff.com>
This commit is contained in:
drew 2026-09-22 15:00:28 +04:00
parent ce8b5107c4
commit c11778a9bb
No known key found for this signature in database
GPG key ID: 877E0EA9036E900E

View file

@ -196,15 +196,22 @@ func TestClipboardBackendErrorsDoNotHangReads(t *testing.T) {
func TestClipboardFallbackDetection(t *testing.T) {
t.Parallel()
t.Run("apple terminal selects a backend on darwin", func(t *testing.T) {
t.Run("apple terminal selects a backend when tools are available", func(t *testing.T) {
t.Parallel()
p := NewProgram(&testModel{}, WithEnvironment([]string{"TERM_PROGRAM=Apple_Terminal", "TERM=xterm-256color"}))
if runtime.GOOS == "darwin" {
// The environment has no DISPLAY or WAYLAND_DISPLAY, so no Linux
// clipboard tool is reachable no matter where the test runs.
p := NewProgram(&testModel{},
WithEnvironment([]string{"TERM_PROGRAM=Apple_Terminal", "TERM=xterm-256color"}))
switch runtime.GOOS {
case "darwin", "windows":
// pbcopy and clip.exe ship with the OS.
if p.clipboard == nil {
t.Error("expected a clipboard backend on darwin")
t.Errorf("expected a clipboard backend on %s", runtime.GOOS)
}
default:
if p.clipboard != nil {
t.Error("expected no clipboard backend without a display")
}
} else if p.clipboard != nil {
t.Error("expected no clipboard backend without a terminal clipboard tool")
}
})