mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
clippy: fix warnings in tests
This commit is contained in:
parent
e03028f2c4
commit
6dd53c7a71
3 changed files with 34 additions and 24 deletions
|
@ -438,7 +438,7 @@ fn test_split_obs_lines_within_combined_shorts() {
|
|||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
let name = "obs-lines-within-shorts";
|
||||
RandomFile::new(&at, name).add_lines(400);
|
||||
RandomFile::new(at, name).add_lines(400);
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
|
@ -446,9 +446,9 @@ fn test_split_obs_lines_within_combined_shorts() {
|
|||
.succeeds()
|
||||
.no_stderr()
|
||||
.no_stdout();
|
||||
let glob = Glob::new(&at, ".", r"x\d\d$");
|
||||
let glob = Glob::new(at, ".", r"x\d\d$");
|
||||
assert_eq!(glob.count(), 2);
|
||||
assert_eq!(glob.collate(), at.read_bytes(name))
|
||||
assert_eq!(glob.collate(), at.read_bytes(name));
|
||||
}
|
||||
|
||||
/// Test for obsolete lines option as part of combined short options with tailing suffix length with value
|
||||
|
@ -470,7 +470,7 @@ fn test_split_obs_lines_starts_combined_shorts() {
|
|||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
let name = "obs-lines-starts-shorts";
|
||||
RandomFile::new(&at, name).add_lines(400);
|
||||
RandomFile::new(at, name).add_lines(400);
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
|
@ -478,9 +478,9 @@ fn test_split_obs_lines_starts_combined_shorts() {
|
|||
.succeeds()
|
||||
.no_stderr()
|
||||
.no_stdout();
|
||||
let glob = Glob::new(&at, ".", r"x\d\d$");
|
||||
let glob = Glob::new(at, ".", r"x\d\d$");
|
||||
assert_eq!(glob.count(), 2);
|
||||
assert_eq!(glob.collate(), at.read_bytes(name))
|
||||
assert_eq!(glob.collate(), at.read_bytes(name));
|
||||
}
|
||||
|
||||
/// Test for using both obsolete lines (standalone) option and short/long lines option simultaneously
|
||||
|
@ -585,7 +585,7 @@ fn test_split_multiple_obs_lines_standalone() {
|
|||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
let name = "multiple-obs-lines";
|
||||
RandomFile::new(&at, name).add_lines(400);
|
||||
RandomFile::new(at, name).add_lines(400);
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
|
@ -593,9 +593,9 @@ fn test_split_multiple_obs_lines_standalone() {
|
|||
.succeeds()
|
||||
.no_stderr()
|
||||
.no_stdout();
|
||||
let glob = Glob::new(&at, ".", r"x[[:alpha:]][[:alpha:]]$");
|
||||
let glob = Glob::new(at, ".", r"x[[:alpha:]][[:alpha:]]$");
|
||||
assert_eq!(glob.count(), 2);
|
||||
assert_eq!(glob.collate(), at.read_bytes(name))
|
||||
assert_eq!(glob.collate(), at.read_bytes(name));
|
||||
}
|
||||
|
||||
/// Test for using more than one obsolete lines option within combined shorts
|
||||
|
@ -605,7 +605,7 @@ fn test_split_multiple_obs_lines_within_combined() {
|
|||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
let name = "multiple-obs-lines";
|
||||
RandomFile::new(&at, name).add_lines(400);
|
||||
RandomFile::new(at, name).add_lines(400);
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
|
@ -613,9 +613,9 @@ fn test_split_multiple_obs_lines_within_combined() {
|
|||
.succeeds()
|
||||
.no_stderr()
|
||||
.no_stdout();
|
||||
let glob = Glob::new(&at, ".", r"x\d\d$");
|
||||
let glob = Glob::new(at, ".", r"x\d\d$");
|
||||
assert_eq!(glob.count(), 2);
|
||||
assert_eq!(glob.collate(), at.read_bytes(name))
|
||||
assert_eq!(glob.collate(), at.read_bytes(name));
|
||||
}
|
||||
|
||||
/// Test for using both obsolete lines option within combined shorts with conflicting -n option simultaneously
|
||||
|
@ -1543,8 +1543,8 @@ fn test_split_separator_nul_lines() {
|
|||
ucmd.args(&["--lines=2", "-t", "\\0", "separator_nul.txt"])
|
||||
.succeeds();
|
||||
|
||||
assert_eq!(file_read(&at, "xaa"), "1\02\0");
|
||||
assert_eq!(file_read(&at, "xab"), "3\04\0");
|
||||
assert_eq!(file_read(&at, "xaa"), "1\x002\0");
|
||||
assert_eq!(file_read(&at, "xab"), "3\x004\0");
|
||||
assert_eq!(file_read(&at, "xac"), "5\0");
|
||||
assert!(!at.plus("xad").exists());
|
||||
}
|
||||
|
@ -1555,8 +1555,8 @@ fn test_split_separator_nul_line_bytes() {
|
|||
ucmd.args(&["--line-bytes=4", "-t", "\\0", "separator_nul.txt"])
|
||||
.succeeds();
|
||||
|
||||
assert_eq!(file_read(&at, "xaa"), "1\02\0");
|
||||
assert_eq!(file_read(&at, "xab"), "3\04\0");
|
||||
assert_eq!(file_read(&at, "xaa"), "1\x002\0");
|
||||
assert_eq!(file_read(&at, "xab"), "3\x004\0");
|
||||
assert_eq!(file_read(&at, "xac"), "5\0");
|
||||
assert!(!at.plus("xad").exists());
|
||||
}
|
||||
|
@ -1567,8 +1567,8 @@ fn test_split_separator_nul_number_l() {
|
|||
ucmd.args(&["--number=l/3", "--separator=\\0", "separator_nul.txt"])
|
||||
.succeeds();
|
||||
|
||||
assert_eq!(file_read(&at, "xaa"), "1\02\0");
|
||||
assert_eq!(file_read(&at, "xab"), "3\04\0");
|
||||
assert_eq!(file_read(&at, "xaa"), "1\x002\0");
|
||||
assert_eq!(file_read(&at, "xab"), "3\x004\0");
|
||||
assert_eq!(file_read(&at, "xac"), "5\0");
|
||||
assert!(!at.plus("xad").exists());
|
||||
}
|
||||
|
@ -1579,8 +1579,8 @@ fn test_split_separator_nul_number_r() {
|
|||
ucmd.args(&["--number=r/3", "--separator=\\0", "separator_nul.txt"])
|
||||
.succeeds();
|
||||
|
||||
assert_eq!(file_read(&at, "xaa"), "1\04\0");
|
||||
assert_eq!(file_read(&at, "xab"), "2\05\0");
|
||||
assert_eq!(file_read(&at, "xaa"), "1\x004\0");
|
||||
assert_eq!(file_read(&at, "xab"), "2\x005\0");
|
||||
assert_eq!(file_read(&at, "xac"), "3\0");
|
||||
assert!(!at.plus("xad").exists());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue