mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
tests: remove all "extern crate" statements
This commit is contained in:
parent
1a8f2a78c0
commit
7a888da409
19 changed files with 18 additions and 69 deletions
|
@ -4,9 +4,7 @@ use std::fs::{metadata, set_permissions, OpenOptions, Permissions};
|
||||||
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
|
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
||||||
extern crate chmod;
|
use libc::umask;
|
||||||
extern crate libc;
|
|
||||||
use self::libc::umask;
|
|
||||||
|
|
||||||
static TEST_FILE: &str = "file";
|
static TEST_FILE: &str = "file";
|
||||||
static REFERENCE_FILE: &str = "reference";
|
static REFERENCE_FILE: &str = "reference";
|
||||||
|
|
|
@ -4,8 +4,6 @@ use crate::common::util::{is_ci, run_ucmd_as_root, CmdResult, TestScenario};
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
use rust_users::get_effective_uid;
|
use rust_users::get_effective_uid;
|
||||||
|
|
||||||
extern crate chown;
|
|
||||||
|
|
||||||
// Apparently some CI environments have configuration issues, e.g. with 'whoami' and 'id'.
|
// Apparently some CI environments have configuration issues, e.g. with 'whoami' and 'id'.
|
||||||
// If we are running inside the CI and "needle" is in "stderr" skipping this test is
|
// If we are running inside the CI and "needle" is in "stderr" skipping this test is
|
||||||
// considered okay. If we are not inside the CI this calls assert!(result.success).
|
// considered okay. If we are not inside the CI this calls assert!(result.success).
|
||||||
|
@ -36,7 +34,7 @@ fn skipping_test_is_okay(result: &CmdResult, needle: &str) -> bool {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test_passgrp {
|
mod test_passgrp {
|
||||||
use super::chown::entries::{gid2grp, grp2gid, uid2usr, usr2uid};
|
use chown::entries::{gid2grp, grp2gid, uid2usr, usr2uid};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_usr2uid() {
|
fn test_usr2uid() {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
extern crate regex;
|
|
||||||
|
|
||||||
use self::regex::Regex;
|
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
|
use regex::Regex;
|
||||||
#[cfg(all(unix, not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
use rust_users::get_effective_uid;
|
use rust_users::get_effective_uid;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#[cfg(not(windows))]
|
|
||||||
extern crate libc;
|
|
||||||
extern crate regex;
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
extern crate tempfile;
|
|
||||||
|
|
||||||
use self::regex::Regex;
|
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
|
use regex::Regex;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* As dir use the same functions than ls, we don't have to retest them here.
|
* As dir use the same functions than ls, we don't have to retest them here.
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// spell-checker:ignore overridable
|
// spell-checker:ignore overridable
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
|
|
||||||
extern crate dircolors;
|
use dircolors::{guess_syntax, OutputFmt, StrUtils};
|
||||||
use self::dircolors::{guess_syntax, OutputFmt, StrUtils};
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use crate::common::util::*;
|
use crate::common::util::TestScenario;
|
||||||
extern crate regex;
|
use regex::Regex;
|
||||||
use self::regex::Regex;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_normal() {
|
fn test_normal() {
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
// spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile tabsize aaaaaaaa bbbb cccc dddddddd ncccc
|
// spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile tabsize aaaaaaaa bbbb cccc dddddddd ncccc
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
extern crate libc;
|
|
||||||
extern crate regex;
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
extern crate tempfile;
|
|
||||||
|
|
||||||
use self::regex::Regex;
|
|
||||||
#[cfg(feature = "feat_selinux")]
|
#[cfg(feature = "feat_selinux")]
|
||||||
use crate::common::util::expected_result;
|
use crate::common::util::expected_result;
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
#[cfg(all(unix, feature = "chmod"))]
|
#[cfg(all(unix, feature = "chmod"))]
|
||||||
use nix::unistd::{close, dup};
|
use nix::unistd::{close, dup};
|
||||||
|
use regex::Regex;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
#[cfg(all(unix, feature = "chmod"))]
|
#[cfg(all(unix, feature = "chmod"))]
|
||||||
use std::os::unix::io::IntoRawFd;
|
use std::os::unix::io::IntoRawFd;
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
use libc::{mode_t, umask};
|
||||||
|
#[cfg(not(windows))]
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
#[cfg(not(windows))]
|
|
||||||
extern crate libc;
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
use self::libc::{mode_t, umask};
|
|
||||||
|
|
||||||
static TEST_DIR1: &str = "mkdir_test1";
|
static TEST_DIR1: &str = "mkdir_test1";
|
||||||
static TEST_DIR2: &str = "mkdir_test2";
|
static TEST_DIR2: &str = "mkdir_test2";
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate filetime;
|
|
||||||
extern crate time;
|
|
||||||
|
|
||||||
use self::filetime::FileTime;
|
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
|
use filetime::FileTime;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
|
|
|
@ -4,15 +4,13 @@
|
||||||
// * For the full copyright and license information, please view the LICENSE
|
// * For the full copyright and license information, please view the LICENSE
|
||||||
// * file that was distributed with this source code.
|
// * file that was distributed with this source code.
|
||||||
|
|
||||||
extern crate unindent;
|
|
||||||
|
|
||||||
use self::unindent::unindent;
|
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::remove_file;
|
use std::fs::remove_file;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
use unindent::unindent;
|
||||||
|
|
||||||
// octal dump of 'abcdefghijklmnopqrstuvwxyz\n' // spell-checker:disable-line
|
// octal dump of 'abcdefghijklmnopqrstuvwxyz\n' // spell-checker:disable-line
|
||||||
static ALPHA_OUT: &str = "
|
static ALPHA_OUT: &str = "
|
||||||
|
|
|
@ -3,14 +3,9 @@
|
||||||
// * For the full copyright and license information, please view the LICENSE
|
// * For the full copyright and license information, please view the LICENSE
|
||||||
// * file that was distributed with this source code.
|
// * file that was distributed with this source code.
|
||||||
|
|
||||||
extern crate uucore;
|
|
||||||
|
|
||||||
use crate::common::util::{expected_result, TestScenario};
|
use crate::common::util::{expected_result, TestScenario};
|
||||||
|
use pinky::Capitalize;
|
||||||
use self::uucore::entries::{Locate, Passwd};
|
use uucore::entries::{Locate, Passwd};
|
||||||
|
|
||||||
extern crate pinky;
|
|
||||||
pub use self::pinky::*;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// spell-checker:ignore (ToDO) Sdivide
|
// spell-checker:ignore (ToDO) Sdivide
|
||||||
extern crate time;
|
|
||||||
|
|
||||||
use crate::common::util::{TestScenario, UCommand};
|
use crate::common::util::{TestScenario, UCommand};
|
||||||
use std::fs::metadata;
|
use std::fs::metadata;
|
||||||
|
|
|
@ -3,13 +3,10 @@
|
||||||
// * For the full copyright and license information, please view the LICENSE
|
// * For the full copyright and license information, please view the LICENSE
|
||||||
// * file that was distributed with this source code.
|
// * file that was distributed with this source code.
|
||||||
// spell-checker:ignore xzaaa sixhundredfiftyonebytes ninetyonebytes threebytes asciilowercase fghij klmno pqrst uvwxyz fivelines twohundredfortyonebytes onehundredlines nbbbb
|
// spell-checker:ignore xzaaa sixhundredfiftyonebytes ninetyonebytes threebytes asciilowercase fghij klmno pqrst uvwxyz fivelines twohundredfortyonebytes onehundredlines nbbbb
|
||||||
extern crate rand;
|
|
||||||
extern crate regex;
|
|
||||||
|
|
||||||
use self::rand::{thread_rng, Rng};
|
|
||||||
use self::regex::Regex;
|
|
||||||
use crate::common::util::{AtPath, TestScenario};
|
use crate::common::util::{AtPath, TestScenario};
|
||||||
use rand::SeedableRng;
|
use rand::{thread_rng, Rng, SeedableRng};
|
||||||
|
use regex::Regex;
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
// * For the full copyright and license information, please view the LICENSE
|
// * For the full copyright and license information, please view the LICENSE
|
||||||
// * file that was distributed with this source code.
|
// * file that was distributed with this source code.
|
||||||
|
|
||||||
extern crate regex;
|
|
||||||
|
|
||||||
use crate::common::util::{expected_result, TestScenario};
|
use crate::common::util::{expected_result, TestScenario};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
extern crate tempfile;
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// spell-checker:ignore (libs) kqueue
|
// spell-checker:ignore (libs) kqueue
|
||||||
// spell-checker:ignore (jargon) tailable untailable datasame runneradmin tmpi
|
// spell-checker:ignore (jargon) tailable untailable datasame runneradmin tmpi
|
||||||
|
|
||||||
extern crate tail;
|
|
||||||
|
|
||||||
use crate::common::random::{AlphanumericNewline, RandomString};
|
use crate::common::random::{AlphanumericNewline, RandomString};
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use crate::common::util::expected_result;
|
use crate::common::util::expected_result;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
extern crate regex;
|
|
||||||
use self::regex::Regex;
|
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
|
use regex::Regex;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#[cfg(not(windows))]
|
|
||||||
extern crate libc;
|
|
||||||
extern crate regex;
|
|
||||||
#[cfg(not(windows))]
|
|
||||||
extern crate tempfile;
|
|
||||||
|
|
||||||
use self::regex::Regex;
|
|
||||||
use crate::common::util::TestScenario;
|
use crate::common::util::TestScenario;
|
||||||
|
use regex::Regex;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* As vdir use the same functions than ls, we don't have to retest them here.
|
* As vdir use the same functions than ls, we don't have to retest them here.
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
#[cfg(unix)]
|
|
||||||
extern crate rust_users;
|
|
||||||
|
|
||||||
#[cfg(feature = "arch")]
|
#[cfg(feature = "arch")]
|
||||||
#[path = "by-util/test_arch.rs"]
|
#[path = "by-util/test_arch.rs"]
|
||||||
mod test_arch;
|
mod test_arch;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue