mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #885 from jbcrail/refactor-tests
Refactor and fix tests
This commit is contained in:
commit
145f2efe89
12 changed files with 101 additions and 122 deletions
20
Cargo.lock
generated
20
Cargo.lock
generated
|
@ -515,7 +515,7 @@ dependencies = [
|
||||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tempfile 1.1.3 (git+https://github.com/Stebalien/tempfile.git)",
|
"tempfile 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"uucore 0.0.1",
|
"uucore 0.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -790,6 +790,19 @@ name = "rustc-serialize"
|
||||||
version = "0.3.16"
|
version = "0.3.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc_version"
|
||||||
|
version = "0.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "semver"
|
||||||
|
version = "0.1.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "seq"
|
name = "seq"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
|
@ -914,12 +927,13 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "1.1.3"
|
version = "2.1.3"
|
||||||
source = "git+https://github.com/Stebalien/tempfile.git#34e42b9fdd931ad694900b0afd7c7553a4ac8dd0"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ unix = [
|
||||||
"logname",
|
"logname",
|
||||||
"mkfifo",
|
"mkfifo",
|
||||||
"mknod",
|
"mknod",
|
||||||
"mktemp",
|
|
||||||
"mv",
|
"mv",
|
||||||
"nice",
|
"nice",
|
||||||
"nohup",
|
"nohup",
|
||||||
|
@ -55,6 +54,7 @@ generic = [
|
||||||
"ln",
|
"ln",
|
||||||
"ls",
|
"ls",
|
||||||
"mkdir",
|
"mkdir",
|
||||||
|
"mktemp",
|
||||||
"nl",
|
"nl",
|
||||||
"nproc",
|
"nproc",
|
||||||
"od",
|
"od",
|
||||||
|
|
|
@ -11,12 +11,11 @@ install:
|
||||||
- rustc -V
|
- rustc -V
|
||||||
- cargo -V
|
- cargo -V
|
||||||
|
|
||||||
build_script:
|
|
||||||
- cargo build --release --features generic --no-default-features
|
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: target\release\uutils.exe
|
- path: target\debug\uutils.exe
|
||||||
name: uutils.exe
|
name: uutils.exe
|
||||||
|
|
||||||
|
build: false
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cargo test --no-fail-fast --features generic --no-default-features
|
- cargo test --no-fail-fast --features generic --no-default-features
|
||||||
|
|
|
@ -12,4 +12,8 @@ uucore = { path="../uucore" }
|
||||||
getopts = "*"
|
getopts = "*"
|
||||||
libc = "*"
|
libc = "*"
|
||||||
rand = "0.3"
|
rand = "0.3"
|
||||||
tempfile = {git = "https://github.com/Stebalien/tempfile.git"}
|
tempfile = "*"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "mktemp"
|
||||||
|
path = "main.rs"
|
||||||
|
|
5
src/mktemp/main.rs
Normal file
5
src/mktemp/main.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
extern crate uu_mktemp;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
std::process::exit(uu_mktemp::uumain(std::env::args().collect()));
|
||||||
|
}
|
|
@ -31,7 +31,6 @@ static VERSION: &'static str = env!("CARGO_PKG_VERSION");
|
||||||
static DEFAULT_TEMPLATE: &'static str = "tmp.XXXXXXXXXX";
|
static DEFAULT_TEMPLATE: &'static str = "tmp.XXXXXXXXXX";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pub fn uumain(args: Vec<String>) -> i32 {
|
pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
let mut opts = getopts::Options::new();
|
let mut opts = getopts::Options::new();
|
||||||
opts.optflag("d", "directory", "Make a directory instead of a file");
|
opts.optflag("d", "directory", "Make a directory instead of a file");
|
||||||
|
@ -171,16 +170,12 @@ pub fn dry_exec(mut tmpdir: PathBuf, prefix: &str, rand: usize, suffix: &str) ->
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fn exec(tmpdir: PathBuf, prefix: &str, rand: usize, suffix: &str, make_dir: bool) -> i32 {
|
fn exec(tmpdir: PathBuf, prefix: &str, rand: usize, suffix: &str, make_dir: bool) -> i32 {
|
||||||
// TODO: respect make_dir option
|
// TODO: respect make_dir option
|
||||||
if make_dir {
|
if make_dir {
|
||||||
crash!(1, "Directory option is not supported yet. Sorry.");
|
crash!(1, "Directory option is not supported yet. Sorry.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let tmpfile = NamedTempFileOptions::new()
|
let tmpfile = NamedTempFileOptions::new()
|
||||||
.prefix(prefix)
|
.prefix(prefix)
|
||||||
.rand_bytes(rand)
|
.rand_bytes(rand)
|
||||||
|
|
48
tests/common/macros.rs
Executable file
48
tests/common/macros.rs
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! assert_empty_stderr(
|
||||||
|
($cond:expr) => (
|
||||||
|
if $cond.stderr.len() > 0 {
|
||||||
|
panic!(format!("stderr: {}", $cond.stderr))
|
||||||
|
}
|
||||||
|
);
|
||||||
|
);
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! assert_empty_stdout(
|
||||||
|
($cond:expr) => (
|
||||||
|
if $cond.stdout.len() > 0 {
|
||||||
|
panic!(format!("stdout: {}", $cond.stdout))
|
||||||
|
}
|
||||||
|
);
|
||||||
|
);
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! assert_no_error(
|
||||||
|
($cond:expr) => (
|
||||||
|
assert!($cond.success);
|
||||||
|
if $cond.stderr.len() > 0 {
|
||||||
|
panic!(format!("stderr: {}", $cond.stderr))
|
||||||
|
}
|
||||||
|
);
|
||||||
|
);
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! path_concat {
|
||||||
|
($e:expr, ..$n:expr) => {{
|
||||||
|
use std::path::PathBuf;
|
||||||
|
let n = $n;
|
||||||
|
let mut pb = PathBuf::new();
|
||||||
|
for _ in 0..n {
|
||||||
|
pb.push($e);
|
||||||
|
}
|
||||||
|
pb.to_str().unwrap().to_owned()
|
||||||
|
}};
|
||||||
|
($($e:expr),*) => {{
|
||||||
|
use std::path::PathBuf;
|
||||||
|
let mut pb = PathBuf::new();
|
||||||
|
$(
|
||||||
|
pb.push($e);
|
||||||
|
)*
|
||||||
|
pb.to_str().unwrap().to_owned()
|
||||||
|
}};
|
||||||
|
}
|
|
@ -1,2 +1,3 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
pub mod macros;
|
||||||
pub mod util;
|
pub mod util;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::{self, File, OpenOptions};
|
use std::fs::{self, File, OpenOptions};
|
||||||
use std::io::{Read, Write, Result};
|
use std::io::{Read, Write, Result};
|
||||||
use std::ops::{Deref, DerefMut};
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::os::unix::fs::symlink as symlink_file;
|
use std::os::unix::fs::symlink as symlink_file;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
@ -18,45 +17,18 @@ use std::time::Duration;
|
||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
static PROGNAME: &'static str = "target\\debug\\uutils.exe";
|
static PROGNAME: &'static str = "uutils.exe";
|
||||||
#[cfg(windows)]
|
|
||||||
static FIXTURES_DIR: &'static str = "tests\\fixtures";
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
static PROGNAME: &'static str = "target/debug/uutils";
|
static PROGNAME: &'static str = "uutils";
|
||||||
#[cfg(not(windows))]
|
|
||||||
static FIXTURES_DIR: &'static str = "tests/fixtures";
|
static TESTS_DIR: &'static str = "tests";
|
||||||
|
static FIXTURES_DIR: &'static str = "fixtures";
|
||||||
|
|
||||||
static ALREADY_RUN: &'static str = " you have already run this UCommand, if you want to run \
|
static ALREADY_RUN: &'static str = " you have already run this UCommand, if you want to run \
|
||||||
another command in the same test, use TestSet::new instead of \
|
another command in the same test, use TestSet::new instead of \
|
||||||
testing();";
|
testing();";
|
||||||
static MULTIPLE_STDIN_MEANINGLESS: &'static str = "Ucommand is designed around a typical use case of: provide args and input stream -> spawn process -> block until completion -> return output streams. For verifying that a particular section of the input stream is what causes a particular behavior, use the Command type directly.";
|
static MULTIPLE_STDIN_MEANINGLESS: &'static str = "Ucommand is designed around a typical use case of: provide args and input stream -> spawn process -> block until completion -> return output streams. For verifying that a particular section of the input stream is what causes a particular behavior, use the Command type directly.";
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! assert_empty_stderr(
|
|
||||||
($cond:expr) => (
|
|
||||||
if $cond.stderr.len() > 0 {
|
|
||||||
panic!(format!("stderr: {}", $cond.stderr))
|
|
||||||
}
|
|
||||||
);
|
|
||||||
);
|
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! assert_empty_stdout(
|
|
||||||
($cond:expr) => (
|
|
||||||
if $cond.stdout.len() > 0 {
|
|
||||||
panic!(format!("stdout: {}", $cond.stdout))
|
|
||||||
}
|
|
||||||
);
|
|
||||||
);
|
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! assert_no_error(
|
|
||||||
($cond:expr) => (
|
|
||||||
assert!($cond.success);
|
|
||||||
if $cond.stderr.len() > 0 {
|
|
||||||
panic!(format!("stderr: {}", $cond.stderr))
|
|
||||||
}
|
|
||||||
);
|
|
||||||
);
|
|
||||||
|
|
||||||
pub fn repeat_str(s: &str, n: u32) -> String {
|
pub fn repeat_str(s: &str, n: u32) -> String {
|
||||||
let mut repeated = String::new();
|
let mut repeated = String::new();
|
||||||
|
@ -66,27 +38,6 @@ pub fn repeat_str(s: &str, n: u32) -> String {
|
||||||
repeated
|
repeated
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! path_concat {
|
|
||||||
($e:expr, ..$n:expr) => {{
|
|
||||||
use std::path::PathBuf;
|
|
||||||
let n = $n;
|
|
||||||
let mut pb = PathBuf::new();
|
|
||||||
for _ in 0..n {
|
|
||||||
pb.push($e);
|
|
||||||
}
|
|
||||||
pb.to_str().unwrap().to_owned()
|
|
||||||
}};
|
|
||||||
($($e:expr),*) => {{
|
|
||||||
use std::path::PathBuf;
|
|
||||||
let mut pb = PathBuf::new();
|
|
||||||
$(
|
|
||||||
pb.push($e);
|
|
||||||
)*
|
|
||||||
pb.to_str().unwrap().to_owned()
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct CmdResult {
|
pub struct CmdResult {
|
||||||
pub success: bool,
|
pub success: bool,
|
||||||
pub stdout: String,
|
pub stdout: String,
|
||||||
|
@ -168,40 +119,6 @@ pub fn get_root_path() -> &'static str {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A scoped, temporary file that is removed upon drop.
|
|
||||||
pub struct ScopedFile {
|
|
||||||
path: PathBuf,
|
|
||||||
file: File,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ScopedFile {
|
|
||||||
fn new(path: PathBuf, file: File) -> ScopedFile {
|
|
||||||
ScopedFile {
|
|
||||||
path: path,
|
|
||||||
file: file
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Deref for ScopedFile {
|
|
||||||
type Target = File;
|
|
||||||
fn deref(&self) -> &File {
|
|
||||||
&self.file
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DerefMut for ScopedFile {
|
|
||||||
fn deref_mut(&mut self) -> &mut File {
|
|
||||||
&mut self.file
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Drop for ScopedFile {
|
|
||||||
fn drop(&mut self) {
|
|
||||||
fs::remove_file(&self.path).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct AtPath {
|
pub struct AtPath {
|
||||||
pub subdir: PathBuf,
|
pub subdir: PathBuf,
|
||||||
}
|
}
|
||||||
|
@ -226,7 +143,6 @@ impl AtPath {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn minus(&self, name: &str) -> PathBuf {
|
fn minus(&self, name: &str) -> PathBuf {
|
||||||
// relative_from is currently unstable
|
|
||||||
let prefixed = PathBuf::from(name);
|
let prefixed = PathBuf::from(name);
|
||||||
if prefixed.starts_with(&self.subdir) {
|
if prefixed.starts_with(&self.subdir) {
|
||||||
let mut unprefixed = PathBuf::new();
|
let mut unprefixed = PathBuf::new();
|
||||||
|
@ -283,10 +199,6 @@ impl AtPath {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn make_scoped_file(&self, name: &str) -> ScopedFile {
|
|
||||||
ScopedFile::new(self.plus(name), self.make_file(name))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn touch(&self, file: &str) {
|
pub fn touch(&self, file: &str) {
|
||||||
log_info("touch", self.plus_as_string(file));
|
log_info("touch", self.plus_as_string(file));
|
||||||
File::create(&self.plus(file)).unwrap();
|
File::create(&self.plus(file)).unwrap();
|
||||||
|
@ -386,17 +298,20 @@ impl TestSet {
|
||||||
let tmpd = Rc::new(TempDir::new("uutils").unwrap());
|
let tmpd = Rc::new(TempDir::new("uutils").unwrap());
|
||||||
let ts = TestSet {
|
let ts = TestSet {
|
||||||
bin_path: {
|
bin_path: {
|
||||||
let mut bin_path_builder = env::current_dir().unwrap();
|
// Instead of hardcoding the path relative to the current
|
||||||
bin_path_builder.push(PathBuf::from(PROGNAME));
|
// directory, use Cargo's OUT_DIR to find path to executable.
|
||||||
bin_path_builder
|
// This allows tests to be run using profiles other than debug.
|
||||||
|
let target_dir = path_concat!(env::var("OUT_DIR").unwrap(), "..", "..", "..", PROGNAME);
|
||||||
|
PathBuf::from(AtPath::new(&Path::new(&target_dir)).root_dir_resolved())
|
||||||
},
|
},
|
||||||
util_name: String::from(util_name),
|
util_name: String::from(util_name),
|
||||||
fixtures: AtPath::new(&tmpd.as_ref().path()),
|
fixtures: AtPath::new(&tmpd.as_ref().path()),
|
||||||
tmpd: tmpd,
|
tmpd: tmpd,
|
||||||
};
|
};
|
||||||
let mut fixture_path_builder = env::current_dir().unwrap();
|
let mut fixture_path_builder = env::current_dir().unwrap();
|
||||||
fixture_path_builder.push(PathBuf::from(FIXTURES_DIR));
|
fixture_path_builder.push(TESTS_DIR);
|
||||||
fixture_path_builder.push(PathBuf::from(util_name));
|
fixture_path_builder.push(FIXTURES_DIR);
|
||||||
|
fixture_path_builder.push(util_name);
|
||||||
match fs::metadata(&fixture_path_builder) {
|
match fs::metadata(&fixture_path_builder) {
|
||||||
Ok(m) => if m.is_dir() {
|
Ok(m) => if m.is_dir() {
|
||||||
recursive_copy(&fixture_path_builder, &ts.fixtures.subdir).unwrap();
|
recursive_copy(&fixture_path_builder, &ts.fixtures.subdir).unwrap();
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
#[macro_use]
|
|
||||||
mod common;
|
|
||||||
|
|
||||||
use common::util::*;
|
use common::util::*;
|
||||||
|
|
||||||
static UTIL_NAME: &'static str = "pathchk";
|
static UTIL_NAME: &'static str = "pathchk";
|
|
@ -65,13 +65,13 @@ fn test_single_big_args() {
|
||||||
|
|
||||||
let (at, mut ucmd) = testing(UTIL_NAME);
|
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||||
|
|
||||||
let mut big_input = at.make_scoped_file(FILE);
|
let mut big_input = at.make_file(FILE);
|
||||||
for i in 0..LINES {
|
for i in 0..LINES {
|
||||||
write!(&mut big_input, "Line {}\n", i).expect("Could not write to FILE");
|
write!(&mut big_input, "Line {}\n", i).expect("Could not write to FILE");
|
||||||
}
|
}
|
||||||
big_input.flush().expect("Could not flush FILE");
|
big_input.flush().expect("Could not flush FILE");
|
||||||
|
|
||||||
let mut big_expected = at.make_scoped_file(EXPECTED_FILE);
|
let mut big_expected = at.make_file(EXPECTED_FILE);
|
||||||
for i in (LINES - N_ARG)..LINES {
|
for i in (LINES - N_ARG)..LINES {
|
||||||
write!(&mut big_expected, "Line {}\n", i).expect("Could not write to EXPECTED_FILE");
|
write!(&mut big_expected, "Line {}\n", i).expect("Could not write to EXPECTED_FILE");
|
||||||
}
|
}
|
||||||
|
@ -104,14 +104,14 @@ fn test_bytes_big() {
|
||||||
|
|
||||||
let (at, mut ucmd) = testing(UTIL_NAME);
|
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||||
|
|
||||||
let mut big_input = at.make_scoped_file(FILE);
|
let mut big_input = at.make_file(FILE);
|
||||||
for i in 0..BYTES {
|
for i in 0..BYTES {
|
||||||
let digit = from_digit((i % 10) as u32, 10).unwrap();
|
let digit = from_digit((i % 10) as u32, 10).unwrap();
|
||||||
write!(&mut big_input, "{}", digit).expect("Could not write to FILE");
|
write!(&mut big_input, "{}", digit).expect("Could not write to FILE");
|
||||||
}
|
}
|
||||||
big_input.flush().expect("Could not flush FILE");
|
big_input.flush().expect("Could not flush FILE");
|
||||||
|
|
||||||
let mut big_expected = at.make_scoped_file(EXPECTED_FILE);
|
let mut big_expected = at.make_file(EXPECTED_FILE);
|
||||||
for i in (BYTES - N_ARG)..BYTES {
|
for i in (BYTES - N_ARG)..BYTES {
|
||||||
let digit = from_digit((i % 10) as u32, 10).unwrap();
|
let digit = from_digit((i % 10) as u32, 10).unwrap();
|
||||||
write!(&mut big_expected, "{}", digit).expect("Could not write to EXPECTED_FILE");
|
write!(&mut big_expected, "{}", digit).expect("Could not write to EXPECTED_FILE");
|
||||||
|
@ -171,13 +171,13 @@ fn test_lines_with_size_suffix() {
|
||||||
|
|
||||||
let (at, mut ucmd) = testing(UTIL_NAME);
|
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||||
|
|
||||||
let mut big_input = at.make_scoped_file(FILE);
|
let mut big_input = at.make_file(FILE);
|
||||||
for i in 0..LINES {
|
for i in 0..LINES {
|
||||||
writeln!(&mut big_input, "Line {}", i).expect("Could not write to FILE");
|
writeln!(&mut big_input, "Line {}", i).expect("Could not write to FILE");
|
||||||
}
|
}
|
||||||
big_input.flush().expect("Could not flush FILE");
|
big_input.flush().expect("Could not flush FILE");
|
||||||
|
|
||||||
let mut big_expected = at.make_scoped_file(EXPECTED_FILE);
|
let mut big_expected = at.make_file(EXPECTED_FILE);
|
||||||
for i in (LINES - N_ARG)..LINES {
|
for i in (LINES - N_ARG)..LINES {
|
||||||
writeln!(&mut big_expected, "Line {}", i).expect("Could not write to EXPECTED_FILE");
|
writeln!(&mut big_expected, "Line {}", i).expect("Could not write to EXPECTED_FILE");
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ mod sieve;
|
||||||
|
|
||||||
#[cfg(unix)] mod test_chmod;
|
#[cfg(unix)] mod test_chmod;
|
||||||
#[cfg(unix)] mod test_mv;
|
#[cfg(unix)] mod test_mv;
|
||||||
|
#[cfg(unix)] mod test_pathchk;
|
||||||
#[cfg(unix)] mod test_stdbuf;
|
#[cfg(unix)] mod test_stdbuf;
|
||||||
#[cfg(unix)] mod test_touch;
|
#[cfg(unix)] mod test_touch;
|
||||||
#[cfg(unix)] mod test_unlink;
|
#[cfg(unix)] mod test_unlink;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue