From c11778a9bb071cc48387ff163ac44456ed859042 Mon Sep 17 00:00:00 2001 From: drew Date: Tue, 22 Sep 2026 15:00:28 +0400 Subject: [PATCH] fix: windows lint and linux ci Signed-off-by: drew --- clipboard_test.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/clipboard_test.go b/clipboard_test.go index 824f3d01..175b47e7 100644 --- a/clipboard_test.go +++ b/clipboard_test.go @@ -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") } })