1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00

Merge pull request #4918 from shinhs0506/core-size

shred: add support for octal and hex size
This commit is contained in:
Sylvestre Ledru 2023-06-03 10:48:19 +02:00 committed by GitHub
commit 160952a42c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 143 additions and 63 deletions

View file

@ -189,6 +189,15 @@ fn test_no_such_file_or_directory() {
.stderr_contains("cannot open 'no_such_file.toml' for reading: No such file or directory");
}
#[test]
fn test_lines_leading_zeros() {
new_ucmd!()
.arg("--lines=010")
.pipe_in("\n\n\n\n\n\n\n\n\n\n\n\n")
.succeeds()
.stdout_is("\n\n\n\n\n\n\n\n\n\n");
}
/// Test that each non-existent files gets its own error message printed.
#[test]
fn test_multiple_nonexistent_files() {

View file

@ -51,3 +51,14 @@ fn test_shred_force() {
// file_a was deleted.
assert!(!at.file_exists(file));
}
#[test]
fn test_hex() {
let (at, mut ucmd) = at_and_ucmd!();
let file = "test_hex";
at.touch(file);
ucmd.arg("--size=0x10").arg(file).succeeds();
}