From aa83446d6b9f62384bdcc10ebcafe4b85a4bc590 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Tue, 26 May 2026 12:23:49 -0500 Subject: [PATCH] fix(tests): use cat instead of true in wlcopy test to avoid EPIPE The wlcopy_helper_succeeds_when_binary_returns_zero test used `true` as a stand-in for wl-copy, but `true` exits immediately without reading stdin. On Linux CI runners the process exits before the parent can write to the pipe, producing EPIPE and failing the is_ok() assertion. Switch to `cat` which reads stdin until EOF (when the pipe is closed) and then exits 0, faithfully modelling a successful wl-copy invocation. --- crates/tui/src/tui/clipboard.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/tui/src/tui/clipboard.rs b/crates/tui/src/tui/clipboard.rs index 2eadfd0f..dffadfac 100644 --- a/crates/tui/src/tui/clipboard.rs +++ b/crates/tui/src/tui/clipboard.rs @@ -442,7 +442,12 @@ mod tests { #[cfg(target_os = "linux")] #[test] fn wlcopy_helper_succeeds_when_binary_returns_zero() { - let result = write_text_with_wlcopy_using_argv("true", "test"); + // Use `cat` instead of `true` because `true` exits immediately + // without reading stdin, causing EPIPE before we can check the + // exit status. `cat` consumes stdin until EOF (when we drop the + // pipe) and then exits 0, faithfully modelling a successful + // wl-copy invocation. + let result = write_text_with_wlcopy_using_argv("cat", "test"); assert!(result.is_ok()); }