1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Add initial tests for default values

This commit is contained in:
Joseph Crail 2015-12-12 16:24:48 -05:00
parent b6abe56357
commit cf399faad2
5 changed files with 55 additions and 0 deletions

View file

@ -143,6 +143,7 @@ TEST_PROGS := \
stdbuf \
sum \
tac \
tail \
test \
touch \
tr \

11
tests/fixtures/tail/foobar.txt vendored Normal file
View file

@ -0,0 +1,11 @@
baz
foo
bar
foo
bar
foo
bar
foo
bar
foo
bar

View file

@ -0,0 +1,10 @@
foo
bar
foo
bar
foo
bar
foo
bar
foo
bar

View file

@ -0,0 +1,10 @@
foo
bar
foo
bar
foo
bar
foo
bar
foo
bar

23
tests/tail.rs Normal file
View file

@ -0,0 +1,23 @@
#[macro_use]
mod common;
use common::util::*;
static UTIL_NAME: &'static str = "tail";
static INPUT: &'static str = "foobar.txt";
#[test]
fn test_stdin_default() {
let (at, mut ucmd) = testing(UTIL_NAME);
let result = ucmd.run_piped_stdin(at.read(INPUT));
assert_eq!(result.stdout, at.read("foobar_stdin_default.expected"));
}
#[test]
fn test_single_default() {
let (at, mut ucmd) = testing(UTIL_NAME);
let result = ucmd.arg(INPUT).run();
assert_eq!(result.stdout, at.read("foobar_single_default.expected"));
}