tests: fix warnings on OpenBSD for unused imports in by-util/test_*

Signed-off-by: Laurent Cheylus <foxy@free.fr>
This commit is contained in:
Laurent Cheylus
2024-07-06 22:45:10 +02:00
parent c25ba39ce6
commit 008dd38a0d
5 changed files with 10 additions and 0 deletions
+3
View File
@@ -11,11 +11,14 @@ use regex::Regex;
use crate::common::util::expected_result;
use crate::common::util::TestScenario;
#[cfg(not(target_os = "openbsd"))]
const SUB_DIR: &str = "subdir/deeper";
const SUB_DEEPER_DIR: &str = "subdir/deeper/deeper_dir";
const SUB_DIR_LINKS: &str = "subdir/links";
const SUB_DIR_LINKS_DEEPER_SYM_DIR: &str = "subdir/links/deeper_dir";
#[cfg(not(target_os = "openbsd"))]
const SUB_FILE: &str = "subdir/links/subwords.txt";
#[cfg(not(target_os = "openbsd"))]
const SUB_LINK: &str = "subdir/links/sublink.txt";
#[test]
+1
View File
@@ -5,6 +5,7 @@
// spell-checker:ignore (words) helloworld nodir objdump n'source
use crate::common::util::{is_ci, run_ucmd_as_root, TestScenario};
#[cfg(not(target_os = "openbsd"))]
use filetime::FileTime;
use std::fs;
use std::os::unix::fs::{MetadataExt, PermissionsExt};
+1
View File
@@ -15,6 +15,7 @@ use crate::common::util::TestScenario;
#[cfg(all(unix, feature = "chmod"))]
use nix::unistd::{close, dup};
use regex::Regex;
#[cfg(not(target_os = "openbsd"))]
use std::collections::HashMap;
#[cfg(target_os = "linux")]
use std::ffi::OsStr;
+1
View File
@@ -4,6 +4,7 @@
// file that was distributed with this source code.
// spell-checker:ignore winsize Openpty openpty xpixel ypixel ptyprocess
use crate::common::util::TestScenario;
#[cfg(not(target_os = "openbsd"))]
use std::thread::sleep;
// General observation: nohup.out will not be created in tests run by cargo test
+4
View File
@@ -3,8 +3,12 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
#[cfg(target_os = "openbsd")]
use crate::common::util::TestScenario;
#[cfg(not(target_os = "openbsd"))]
use crate::common::util::{expected_result, TestScenario};
use pinky::Capitalize;
#[cfg(not(target_os = "openbsd"))]
use uucore::entries::{Locate, Passwd};
#[test]