From 0555745052dd3cc65faf7ed6dddc4ca1569c2b2e Mon Sep 17 00:00:00 2001 From: Jan Scheer Date: Fri, 5 Aug 2022 08:04:25 +0200 Subject: [PATCH] tests: fix Freebsd test failures --- tests/by-util/test_tail.rs | 7 ++----- tests/by-util/test_wc.rs | 4 +--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/by-util/test_tail.rs b/tests/by-util/test_tail.rs index d45c0ecb1e3..37a317892af 100644 --- a/tests/by-util/test_tail.rs +++ b/tests/by-util/test_tail.rs @@ -20,11 +20,6 @@ use std::thread::sleep; #[cfg(unix)] use std::time::Duration; -#[cfg(target_os = "linux")] -pub static BACKEND: &str = "inotify"; -// #[cfg(all(unix, not(target_os = "linux")))] -// pub static BACKEND: &str = "kqueue"; - static FOOBAR_TXT: &str = "foobar.txt"; static FOOBAR_2_TXT: &str = "foobar2.txt"; static FOOBAR_WITH_NULL_TXT: &str = "foobar_with_null.txt"; @@ -1446,6 +1441,8 @@ fn test_retry9() { // Ensure that inotify will switch to polling mode if directory // of the watched file was removed and recreated. + use tail::text::BACKEND; + let ts = TestScenario::new(util_name!()); let at = &ts.fixtures; let watched_file = std::path::Path::new("watched_file"); diff --git a/tests/by-util/test_wc.rs b/tests/by-util/test_wc.rs index 9f509183ce5..d9166cb92e6 100644 --- a/tests/by-util/test_wc.rs +++ b/tests/by-util/test_wc.rs @@ -1,6 +1,3 @@ -#[cfg(all(unix, not(target_os = "macos")))] -use pretty_assertions::assert_ne; - use crate::common::util::*; // spell-checker:ignore (flags) lwmcL clmwL ; (path) bogusfile emptyfile manyemptylines moby notrailingnewline onelongemptyline onelongword weirdchars @@ -404,6 +401,7 @@ fn test_read_from_nonexistent_file() { #[test] #[cfg(any(target_os = "linux", target_os = "android"))] fn test_files_from_pseudo_filesystem() { + use pretty_assertions::assert_ne; let result = new_ucmd!().arg("-c").arg("/proc/cpuinfo").succeeds(); assert_ne!(result.stdout_str(), "0 /proc/cpuinfo\n"); }