mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 03:36:18 +00:00
Merge branch 'main' into tail_notify
This commit is contained in:
commit
6a1cf72316
11 changed files with 195 additions and 141 deletions
|
@ -566,6 +566,19 @@ fn test_invalid_block_size() {
|
|||
.stderr_contains("invalid --block-size argument '0K'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_invalid_block_size_suffix() {
|
||||
new_ucmd!()
|
||||
.arg("--block-size=1H")
|
||||
.fails()
|
||||
.stderr_contains("invalid suffix in --block-size argument '1H'");
|
||||
|
||||
new_ucmd!()
|
||||
.arg("--block-size=1.2")
|
||||
.fails()
|
||||
.stderr_contains("invalid suffix in --block-size argument '1.2'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_output_selects_columns() {
|
||||
let output = new_ucmd!()
|
||||
|
|
|
@ -94,7 +94,13 @@ fn test_du_invalid_size() {
|
|||
.arg("/tmp")
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.stderr_only(format!("du: invalid --{} argument '1fb4t'", s));
|
||||
.stderr_only(format!("du: invalid suffix in --{} argument '1fb4t'", s));
|
||||
ts.ucmd()
|
||||
.arg(format!("--{}=x", s))
|
||||
.arg("/tmp")
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.stderr_only(format!("du: invalid --{} argument 'x'", s));
|
||||
#[cfg(not(target_pointer_width = "128"))]
|
||||
ts.ucmd()
|
||||
.arg(format!("--{}=1Y", s))
|
||||
|
|
|
@ -827,7 +827,8 @@ fn test_traditional_only_label() {
|
|||
|
||||
#[test]
|
||||
fn test_od_invalid_bytes() {
|
||||
const INVALID_SIZE: &str = "1fb4t";
|
||||
const INVALID_SIZE: &str = "x";
|
||||
const INVALID_SUFFIX: &str = "1fb4t";
|
||||
const BIG_SIZE: &str = "1Y";
|
||||
|
||||
// NOTE:
|
||||
|
@ -852,6 +853,16 @@ fn test_od_invalid_bytes() {
|
|||
option, INVALID_SIZE
|
||||
));
|
||||
|
||||
new_ucmd!()
|
||||
.arg(format!("{}={}", option, INVALID_SUFFIX))
|
||||
.arg("file")
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.stderr_only(format!(
|
||||
"od: invalid suffix in {} argument '{}'",
|
||||
option, INVALID_SUFFIX
|
||||
));
|
||||
|
||||
#[cfg(not(target_pointer_width = "128"))]
|
||||
new_ucmd!()
|
||||
.arg(format!("{}={}", option, BIG_SIZE))
|
||||
|
|
|
@ -56,18 +56,20 @@ fn test_buffer_sizes() {
|
|||
|
||||
#[test]
|
||||
fn test_invalid_buffer_size() {
|
||||
let buffer_sizes = ["asd", "100f"];
|
||||
for invalid_buffer_size in &buffer_sizes {
|
||||
new_ucmd!()
|
||||
.arg("-S")
|
||||
.arg(invalid_buffer_size)
|
||||
.fails()
|
||||
.code_is(2)
|
||||
.stderr_only(format!(
|
||||
"sort: invalid --buffer-size argument '{}'",
|
||||
invalid_buffer_size
|
||||
));
|
||||
}
|
||||
new_ucmd!()
|
||||
.arg("-S")
|
||||
.arg("asd")
|
||||
.fails()
|
||||
.code_is(2)
|
||||
.stderr_only("sort: invalid --buffer-size argument 'asd'");
|
||||
|
||||
new_ucmd!()
|
||||
.arg("-S")
|
||||
.arg("100f")
|
||||
.fails()
|
||||
.code_is(2)
|
||||
.stderr_only("sort: invalid suffix in --buffer-size argument '100f'");
|
||||
|
||||
#[cfg(not(target_pointer_width = "128"))]
|
||||
new_ucmd!()
|
||||
.arg("-n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue