tests: expand wildcard imports

This commit is contained in:
Daniel Hofstetter 2023-03-20 14:51:19 +01:00
parent b8f2f295a6
commit 6988eb7ec6
100 changed files with 107 additions and 107 deletions

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_arch() {

View file

@ -6,7 +6,7 @@
// that was distributed with this source code.
//
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_encode() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_encode() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) reallylongexecutable
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(any(unix, target_os = "redox"))]
use std::ffi::OsStr;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_z85_not_padded() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore NOFILE
use crate::common::util::*;
use crate::common::util::{vec_of_size, TestScenario};
#[cfg(any(target_os = "linux", target_os = "android"))]
use rlimit::Resource;
use std::fs::OpenOptions;

View file

@ -1,7 +1,7 @@
// spell-checker:ignore (words) nosuchgroup groupname
use crate::common::util::*;
use rust_users::*;
use crate::common::util::TestScenario;
use rust_users::get_effective_gid;
#[test]
fn test_invalid_option() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::{AtPath, TestScenario, UCommand};
use once_cell::sync::Lazy;
use std::fs::{metadata, set_permissions, OpenOptions, Permissions};
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) agroupthatdoesntexist auserthatdoesntexist cuuser groupname notexisting passgrp
use crate::common::util::*;
use crate::common::util::{is_ci, run_ucmd_as_root, CmdResult, TestScenario};
#[cfg(any(target_os = "linux", target_os = "android"))]
use rust_users::get_effective_uid;

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) araba newroot userspec chdir pwd's isroot
use crate::common::util::*;
use crate::common::util::{is_ci, run_ucmd_as_root, TestScenario};
#[test]
fn test_invalid_arg() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) asdf
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) defaultcheck nocheck
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (flags) reflink (fs) tmpfs (linux) rlimit Rlim NOFILE clob btrfs ROOTDIR USERDIR procfs outfile
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(not(windows))]
use std::fs::set_permissions;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use glob::glob;
/// Returns a string of numbers with the given range, each on a new line.

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
static INPUT: &str = "lists.txt";

View file

@ -1,9 +1,9 @@
extern crate regex;
use self::regex::Regex;
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(all(unix, not(target_os = "macos")))]
use rust_users::*;
use rust_users::get_effective_uid;
#[test]
fn test_invalid_arg() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, availible, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, iseek, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, oseek, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat abcdefghijklm abcdefghi nabcde nabcdefg abcdefg
use crate::common::util::*;
use crate::common::util::{TestScenario, UCommand, TESTS_BINARY};
use regex::Regex;

View file

@ -1,7 +1,7 @@
// spell-checker:ignore udev pcent iuse itotal iused ipcent
use std::collections::HashSet;
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -5,7 +5,7 @@ extern crate regex;
extern crate tempfile;
use self::regex::Regex;
use crate::common::util::*;
use crate::common::util::TestScenario;
/*
* As dir use the same functions than ls, we don't have to retest them here.

View file

@ -1,5 +1,5 @@
// spell-checker:ignore overridable
use crate::common::util::*;
use crate::common::util::TestScenario;
extern crate dircolors;
use self::dircolors::{guess_syntax, OutputFmt, StrUtils};

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -9,7 +9,7 @@ use regex::Regex;
#[cfg(not(windows))]
use std::io::Write;
use crate::common::util::*;
use crate::common::util::{expected_result, TestScenario};
const SUB_DIR: &str = "subdir/deeper";
const SUB_DEEPER_DIR: &str = "subdir/deeper/deeper_dir";

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) araba merci
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_default() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) bamf chdir rlimit prlimit COMSPEC
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::env;
use std::path::Path;
use tempfile::tempdir;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use uucore::display::Quotable;
// spell-checker:ignore (ToDO) taaaa tbbbb tcccc

View file

@ -1,6 +1,6 @@
// spell-checker:ignore αbcdef ; (people) kkos
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_simple_values() {

View file

@ -8,7 +8,7 @@
// spell-checker:ignore (methods) hexdigest
use crate::common::util::*;
use crate::common::util::{AtPath, TestScenario};
use std::time::{Duration, SystemTime};

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "netbsd"))]
use std::fs::OpenOptions;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -5,7 +5,7 @@
//spell-checker: ignore coreutil
use crate::common::util::*;
use crate::common::util::{check_coreutil_version, expected_result, whoami, TestScenario};
const VERSION_MIN_MULTIPLE_USERS: &str = "8.31"; // this feature was introduced in GNU's coreutils 8.31

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
// spell-checker:ignore checkfile, nonames, testf, ntestf
macro_rules! get_hash(
($str:expr) => (

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (words) bogusfile emptyfile abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstu
use crate::common::util::*;
use crate::common::util::TestScenario;
static INPUT: &str = "lorem_ipsum.txt";

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_hostname() {

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (ToDO) coreutil
use crate::common::util::*;
use crate::common::util::{check_coreutil_version, expected_result, is_ci, whoami, TestScenario};
const VERSION_MIN_MULTIPLE_USERS: &str = "8.31"; // this feature was introduced in GNU's coreutils 8.31

View file

@ -1,8 +1,8 @@
// spell-checker:ignore (words) helloworld nodir objdump n'source
use crate::common::util::*;
use crate::common::util::{is_ci, TestScenario};
use filetime::FileTime;
use rust_users::*;
use rust_users::{get_effective_gid, get_effective_uid};
use std::os::unix::fs::PermissionsExt;
#[cfg(not(any(windows, target_os = "freebsd")))]
use std::process::Command;

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) autoformat nocheck
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "netbsd"))]
use std::fs::OpenOptions;
#[cfg(unix)]

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use regex::Regex;
use std::os::unix::process::ExitStatusExt;
use std::process::{Child, Command};

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::path::PathBuf;
#[test]

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::{is_ci, TestScenario};
use std::env;
#[test]

View file

@ -7,7 +7,7 @@ extern crate regex;
extern crate tempfile;
use self::regex::Regex;
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(all(unix, feature = "chmod"))]
use nix::unistd::{close, dup};
use std::collections::HashMap;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(not(windows))]
use std::os::unix::fs::PermissionsExt;
#[cfg(not(windows))]

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
#[cfg(not(windows))]

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (words) gpghome
use crate::common::util::*;
use crate::common::util::TestScenario;
use uucore::display::Quotable;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use is_terminal::IsTerminal;
#[test]

View file

@ -1,8 +1,8 @@
extern crate filetime;
extern crate time;
use self::filetime::*;
use crate::common::util::*;
use self::filetime::FileTime;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
#[cfg(not(target_os = "android"))]

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::thread::sleep;
// General observation: nohup.out will not be created in tests run by cargo test

View file

@ -1,5 +1,5 @@
// spell-checker:ignore incorrectnumber
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,6 +1,6 @@
// spell-checker:ignore (paths) gnutest
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -6,8 +6,8 @@
extern crate unindent;
use self::unindent::*;
use crate::common::util::*;
use self::unindent::unindent;
use crate::common::util::TestScenario;
use std::env;
use std::fs::remove_file;
use std::fs::File;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
struct TestData<'b> {
name: &'b str,

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -5,7 +5,7 @@
extern crate uucore;
use crate::common::util::*;
use crate::common::util::{expected_result, TestScenario};
use self::uucore::entries::{Locate, Passwd};

View file

@ -1,7 +1,7 @@
// spell-checker:ignore (ToDO) Sdivide
extern crate time;
use crate::common::util::*;
use crate::common::util::{TestScenario, UCommand};
use std::fs::metadata;
use time::macros::format_description;
use time::Duration;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::env;
#[test]

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn basic_literal() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -2,7 +2,7 @@
use std::path::PathBuf;
use crate::common::util::*;
use crate::common::util::{TestScenario, UCommand};
#[test]
fn test_invalid_arg() {

View file

@ -1,5 +1,5 @@
// spell-checker:ignore regfile
use crate::common::util::*;
use crate::common::util::{get_root_path, TestScenario};
static GIBBERISH: &str = "supercalifragilisticexpialidocious";

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::{get_root_path, TestScenario};
#[cfg(windows)]
use regex::Regex;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::borrow::Cow;
use std::path::Path;

View file

@ -1,6 +1,6 @@
use std::process::Stdio;
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
const DIR: &str = "dir";
const DIR_FILE: &str = "dir/file";

View file

@ -1,5 +1,5 @@
// spell-checker:ignore lmnop xlmnop
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::process::Stdio;
#[test]

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,7 +1,7 @@
use rstest::rstest;
// spell-checker:ignore dont
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::time::{Duration, Instant};

View file

@ -7,7 +7,7 @@
use std::time::Duration;
use crate::common::util::*;
use crate::common::util::TestScenario;
fn test_helper(file_name: &str, possible_args: &[&str]) {
for args in possible_args {

View file

@ -8,7 +8,7 @@ extern crate regex;
use self::rand::{thread_rng, Rng};
use self::regex::Regex;
use crate::common::util::*;
use crate::common::util::{AtPath, TestScenario};
use rand::SeedableRng;
#[cfg(not(windows))]
use std::env;

View file

@ -5,7 +5,7 @@
extern crate regex;
use crate::common::util::*;
use crate::common::util::{expected_result, TestScenario};
#[test]
fn test_invalid_arg() {

View file

@ -1,5 +1,5 @@
#[cfg(not(target_os = "windows"))]
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(not(target_os = "windows"))]
#[test]

View file

@ -1,6 +1,6 @@
// spell-checker:ignore parenb parmrk ixany iuclc onlcr ofdel icanon noflsh
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
extern crate tempfile;
use std::fs;
use tempfile::tempdir;

View file

@ -1,5 +1,5 @@
// spell-checker:ignore axxbxx bxxaxx axxx axxxx xxaxx xxax xxxxa axyz zyax zyxa
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -9,8 +9,8 @@
extern crate tail;
use crate::common::random::*;
use crate::common::util::*;
use crate::common::random::{AlphanumericNewline, RandomString};
use crate::common::util::{expected_result, is_ci, TestScenario};
use pretty_assertions::assert_eq;
use rand::distributions::Alphanumeric;
use rstest::rstest;

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
// tests for basic tee functionality.
// inspired by:
@ -108,7 +108,7 @@ fn test_tee_no_more_writeable_2() {
#[cfg(target_os = "linux")]
mod linux_only {
use crate::common::util::*;
use crate::common::util::{AtPath, TestScenario, UCommand};
use std::fs::File;
use std::process::{Output, Stdio};

View file

@ -10,7 +10,7 @@
// spell-checker:ignore (words) egid euid pseudofloat
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::thread::sleep;
#[test]

View file

@ -1,5 +1,5 @@
// spell-checker:ignore dont
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -12,7 +12,7 @@ use self::touch::filetime::{self, FileTime};
extern crate time;
use time::macros::{datetime, format_description};
use crate::common::util::*;
use crate::common::util::{AtPath, TestScenario};
use std::fs::remove_file;
use std::path::PathBuf;

View file

@ -1,5 +1,5 @@
// spell-checker:ignore aabbaa aabbcc aabc abbb abcc abcdefabcdef abcdefghijk abcdefghijklmn abcdefghijklmnop ABCDEFGHIJKLMNOPQRS abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFZZ abcxyz ABCXYZ abcxyzabcxyz ABCXYZABCXYZ acbdef alnum amzamz AMZXAMZ bbbd cclass cefgm cntrl compl dabcdef dncase Gzabcdefg PQRST upcase wxyzz xdigit xycde xyyye xyyz xyzzzzxyzzzz ZABCDEF Zamz Cdefghijkl Cdefghijklmn
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "netbsd"))]
use std::fs::OpenOptions;

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (words) RFILE
use crate::common::util::*;
use crate::common::util::TestScenario;
use std::io::{Seek, SeekFrom, Write};
static FILE1: &str = "truncate_test_1";

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,6 +1,6 @@
use std::fs::File;
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
#[cfg(not(windows))]

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,7 +1,7 @@
use std::io::Write;
// spell-checker:ignore nabcd
use crate::common::util::*;
use crate::common::util::TestScenario;
static INPUT: &str = "sorted.txt";
static OUTPUT: &str = "sorted-output.txt";

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,6 +1,6 @@
extern crate regex;
use self::regex::Regex;
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::TestScenario;
#[test]
fn test_invalid_arg() {

View file

@ -5,7 +5,7 @@ extern crate regex;
extern crate tempfile;
use self::regex::Regex;
use crate::common::util::*;
use crate::common::util::TestScenario;
/*
* As vdir use the same functions than ls, we don't have to retest them here.

View file

@ -1,4 +1,4 @@
use crate::common::util::*;
use crate::common::util::{vec_of_size, TestScenario};
// spell-checker:ignore (flags) lwmcL clmwL ; (path) bogusfile emptyfile manyemptylines moby notrailingnewline onelongemptyline onelongword weirdchars

View file

@ -5,7 +5,7 @@
// spell-checker:ignore (flags) runlevel mesg
use crate::common::util::*;
use crate::common::util::{expected_result, TestScenario};
#[test]
fn test_invalid_arg() {

View file

@ -3,7 +3,7 @@
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.
use crate::common::util::*;
use crate::common::util::{expected_result, is_ci, whoami, TestScenario};
#[test]
fn test_invalid_arg() {

View file

@ -3,7 +3,7 @@ use std::process::{ExitStatus, Stdio};
#[cfg(unix)]
use std::os::unix::process::ExitStatusExt;
use crate::common::util::*;
use crate::common::util::TestScenario;
#[cfg(unix)]
fn check_termination(result: &ExitStatus) {