mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 19:56:17 +00:00
Merge branch 'master' into ls_bad_fd_2
This commit is contained in:
commit
e1bffea595
11 changed files with 111 additions and 77 deletions
|
@ -328,3 +328,21 @@ fn single_file_with_header() {
|
|||
.succeeds()
|
||||
.stdout_is("A 1\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_line_feeds() {
|
||||
new_ucmd!()
|
||||
.arg("non-line_feeds_1.txt")
|
||||
.arg("non-line_feeds_2.txt")
|
||||
.succeeds()
|
||||
.stdout_only_fixture("non-line_feeds.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_unicode() {
|
||||
new_ucmd!()
|
||||
.arg("non-unicode_1.bin")
|
||||
.arg("non-unicode_2.bin")
|
||||
.succeeds()
|
||||
.stdout_only_fixture("non-unicode.expected");
|
||||
}
|
||||
|
|
|
@ -63,9 +63,7 @@ fn test_tee_append() {
|
|||
fn test_tee_no_more_writeable_1() {
|
||||
// equals to 'tee /dev/full out2 <multi_read' call
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let content = (1..=10)
|
||||
.map(|x| format!("{}\n", x.to_string()))
|
||||
.collect::<String>();
|
||||
let content = (1..=10).map(|x| format!("{}\n", x)).collect::<String>();
|
||||
let file_out = "tee_file_out";
|
||||
|
||||
ucmd.arg("/dev/full")
|
||||
|
@ -85,9 +83,7 @@ fn test_tee_no_more_writeable_2() {
|
|||
// but currently there is no way to redirect stdout to /dev/full
|
||||
// so this test is disabled
|
||||
let (_at, mut ucmd) = at_and_ucmd!();
|
||||
let _content = (1..=10)
|
||||
.map(|x| format!("{}\n", x.to_string()))
|
||||
.collect::<String>();
|
||||
let _content = (1..=10).map(|x| format!("{}\n", x)).collect::<String>();
|
||||
let file_out_a = "tee_file_out_a";
|
||||
let file_out_b = "tee_file_out_b";
|
||||
|
||||
|
|
|
@ -1230,14 +1230,7 @@ pub fn check_coreutil_version(
|
|||
.output()
|
||||
{
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
return Err(format!(
|
||||
"{}: '{}' {}",
|
||||
UUTILS_WARNING,
|
||||
util_name,
|
||||
e.to_string()
|
||||
))
|
||||
}
|
||||
Err(e) => return Err(format!("{}: '{}' {}", UUTILS_WARNING, util_name, e)),
|
||||
};
|
||||
std::str::from_utf8(&version_check.stdout).unwrap()
|
||||
.split('\n')
|
||||
|
@ -1247,7 +1240,7 @@ pub fn check_coreutil_version(
|
|||
|| Err(format!("{}: unexpected output format for reference coreutil: '{} --version'", UUTILS_WARNING, util_name)),
|
||||
|s| {
|
||||
if s.contains(&format!("(GNU coreutils) {}", version_expected)) {
|
||||
Ok(format!("{}: {}", UUTILS_INFO, s.to_string()))
|
||||
Ok(format!("{}: {}", UUTILS_INFO, s))
|
||||
} else if s.contains("(GNU coreutils)") {
|
||||
let version_found = parse_coreutil_version(s);
|
||||
let version_expected = version_expected.parse::<f32>().unwrap_or_default();
|
||||
|
|
2
tests/fixtures/join/non-line_feeds.expected
vendored
Normal file
2
tests/fixtures/join/non-line_feeds.expected
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
b
d
|
||||
a c f
|
2
tests/fixtures/join/non-line_feeds_1.txt
vendored
Normal file
2
tests/fixtures/join/non-line_feeds_1.txt
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
b
|
||||
a c
|
2
tests/fixtures/join/non-line_feeds_2.txt
vendored
Normal file
2
tests/fixtures/join/non-line_feeds_2.txt
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
d
|
||||
a f
|
BIN
tests/fixtures/join/non-unicode.expected
vendored
Normal file
BIN
tests/fixtures/join/non-unicode.expected
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/join/non-unicode_1.bin
vendored
Normal file
BIN
tests/fixtures/join/non-unicode_1.bin
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/join/non-unicode_2.bin
vendored
Normal file
BIN
tests/fixtures/join/non-unicode_2.bin
vendored
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue