mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 19:56:17 +00:00
use semicolons if nothing returned
This commit is contained in:
parent
a2d5f06be4
commit
784f2e2ea1
56 changed files with 125 additions and 127 deletions
|
@ -461,9 +461,9 @@ fn set_file_context(path: impl AsRef<Path>, context: &str) -> Result<(), selinux
|
|||
context,
|
||||
path.display(),
|
||||
r
|
||||
)
|
||||
);
|
||||
} else {
|
||||
println!("set_file_context: '{}' => '{}'.", context, path.display())
|
||||
println!("set_file_context: '{}' => '{}'.", context, path.display());
|
||||
}
|
||||
r
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ mod test_passgrp {
|
|||
#[test]
|
||||
fn test_grp2gid() {
|
||||
if cfg!(target_os = "linux") || cfg!(target_os = "android") || cfg!(target_os = "windows") {
|
||||
assert_eq!(0, grp2gid("root").unwrap())
|
||||
assert_eq!(0, grp2gid("root").unwrap());
|
||||
} else {
|
||||
assert_eq!(0, grp2gid("wheel").unwrap());
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ fn test_change_directory() {
|
|||
.arg(pwd)
|
||||
.succeeds()
|
||||
.stdout_move_str();
|
||||
assert_eq!(out.trim(), temporary_path.as_os_str())
|
||||
assert_eq!(out.trim(), temporary_path.as_os_str());
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
|
|
|
@ -1551,7 +1551,7 @@ fn test_ls_inode() {
|
|||
assert!(!re_long.is_match(result.stdout_str()));
|
||||
assert!(!result.stdout_str().contains(inode_long));
|
||||
|
||||
assert_eq!(inode_short, inode_long)
|
||||
assert_eq!(inode_short, inode_long);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -1901,7 +1901,7 @@ fn test_ls_version_sort() {
|
|||
assert_eq!(
|
||||
result.stdout_str().split('\n').collect::<Vec<_>>(),
|
||||
expected,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -75,7 +75,7 @@ fn test_symbolic_mode() {
|
|||
|
||||
ucmd.arg("-m").arg("a=rwx").arg(TEST_DIR1).succeeds();
|
||||
let perms = at.metadata(TEST_DIR1).permissions().mode();
|
||||
assert_eq!(perms, 0o40777)
|
||||
assert_eq!(perms, 0o40777);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -85,7 +85,7 @@ fn test_symbolic_alteration() {
|
|||
|
||||
ucmd.arg("-m").arg("-w").arg(TEST_DIR1).succeeds();
|
||||
let perms = at.metadata(TEST_DIR1).permissions().mode();
|
||||
assert_eq!(perms, 0o40555)
|
||||
assert_eq!(perms, 0o40555);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -98,5 +98,5 @@ fn test_multi_symbolic() {
|
|||
.arg(TEST_DIR1)
|
||||
.succeeds();
|
||||
let perms = at.metadata(TEST_DIR1).permissions().mode();
|
||||
assert_eq!(perms, 0o40750)
|
||||
assert_eq!(perms, 0o40750);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ fn test_head_count() {
|
|||
result_seq.iter().all(|x| input_seq.contains(x)),
|
||||
"Output includes element not from input: {}",
|
||||
result.stdout_str()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -129,7 +129,7 @@ fn test_repeat() {
|
|||
.iter()
|
||||
.filter(|x| !input_seq.contains(x))
|
||||
.collect::<Vec<&i32>>()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -155,7 +155,7 @@ fn test_multiple_decimals_general() {
|
|||
test_helper(
|
||||
"multiple_decimals_general",
|
||||
&["-g", "--general-numeric-sort", "--sort=general-numeric"],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -163,7 +163,7 @@ fn test_multiple_decimals_numeric() {
|
|||
test_helper(
|
||||
"multiple_decimals_numeric",
|
||||
&["-n", "--numeric-sort", "--sort=numeric"],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -171,7 +171,7 @@ fn test_numeric_with_trailing_invalid_chars() {
|
|||
test_helper(
|
||||
"numeric_trailing_chars",
|
||||
&["-n", "--numeric-sort", "--sort=numeric"],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -588,7 +588,7 @@ fn test_keys_with_options_blanks_start() {
|
|||
|
||||
#[test]
|
||||
fn test_keys_blanks_with_char_idx() {
|
||||
test_helper("keys_blanks", &["-k 1.2b"])
|
||||
test_helper("keys_blanks", &["-k 1.2b"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -648,7 +648,7 @@ fn test_keys_negative_size_match() {
|
|||
|
||||
#[test]
|
||||
fn test_keys_ignore_flag() {
|
||||
test_helper("keys_ignore_flag", &["-k 1n -b"])
|
||||
test_helper("keys_ignore_flag", &["-k 1n -b"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -27,7 +27,7 @@ fn get_symlink_times(at: &AtPath, path: &str) -> (FileTime, FileTime) {
|
|||
}
|
||||
|
||||
fn set_file_times(at: &AtPath, path: &str, atime: FileTime, mtime: FileTime) {
|
||||
filetime::set_file_times(&at.plus_as_string(path), atime, mtime).unwrap()
|
||||
filetime::set_file_times(&at.plus_as_string(path), atime, mtime).unwrap();
|
||||
}
|
||||
|
||||
// Adjusts for local timezone
|
||||
|
|
|
@ -241,7 +241,7 @@ impl CmdResult {
|
|||
"stdout was {}\nExpected any of {:#?}",
|
||||
self.stdout_str(),
|
||||
expected
|
||||
)
|
||||
);
|
||||
}
|
||||
self
|
||||
}
|
||||
|
@ -419,14 +419,14 @@ impl CmdResult {
|
|||
|
||||
pub fn stdout_matches(&self, regex: ®ex::Regex) -> &CmdResult {
|
||||
if !regex.is_match(self.stdout_str().trim()) {
|
||||
panic!("Stdout does not match regex:\n{}", self.stdout_str())
|
||||
panic!("Stdout does not match regex:\n{}", self.stdout_str());
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
pub fn stdout_does_not_match(&self, regex: ®ex::Regex) -> &CmdResult {
|
||||
if regex.is_match(self.stdout_str().trim()) {
|
||||
panic!("Stdout matches regex:\n{}", self.stdout_str())
|
||||
panic!("Stdout matches regex:\n{}", self.stdout_str());
|
||||
}
|
||||
self
|
||||
}
|
||||
|
@ -1059,7 +1059,7 @@ impl UCommand {
|
|||
.write_all(input);
|
||||
if !self.ignore_stdin_write_error {
|
||||
if let Err(e) = write_result {
|
||||
panic!("failed to write to stdin of child: {}", e)
|
||||
panic!("failed to write to stdin of child: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue