mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
tests ~ reorganize tests
This commit is contained in:
parent
1c88bc8c45
commit
de0375f909
75 changed files with 0 additions and 0 deletions
87
tests/by-util/test_head.rs
Normal file
87
tests/by-util/test_head.rs
Normal file
|
@ -0,0 +1,87 @@
|
|||
use crate::common::util::*;
|
||||
|
||||
static INPUT: &'static str = "lorem_ipsum.txt";
|
||||
|
||||
#[test]
|
||||
fn test_stdin_default() {
|
||||
new_ucmd!()
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_default.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_1_line_obsolete() {
|
||||
new_ucmd!()
|
||||
.args(&["-1"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_1_line.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_1_line() {
|
||||
new_ucmd!()
|
||||
.args(&["-n", "1"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_1_line.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_negative_23_line() {
|
||||
new_ucmd!()
|
||||
.args(&["-n", "-23"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_1_line.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_5_chars() {
|
||||
new_ucmd!()
|
||||
.args(&["-c", "5"])
|
||||
.pipe_in_fixture(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_5_chars.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_single_default() {
|
||||
new_ucmd!()
|
||||
.arg(INPUT)
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_default.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_single_1_line_obsolete() {
|
||||
new_ucmd!()
|
||||
.args(&["-1", INPUT])
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_1_line.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_single_1_line() {
|
||||
new_ucmd!()
|
||||
.args(&["-n", "1", INPUT])
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_1_line.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_single_5_chars() {
|
||||
new_ucmd!()
|
||||
.args(&["-c", "5", INPUT])
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_5_chars.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_verbose() {
|
||||
new_ucmd!()
|
||||
.args(&["-v", INPUT])
|
||||
.run()
|
||||
.stdout_is_fixture("lorem_ipsum_verbose.expected");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue