rev: add option --zero

closes #74
This commit is contained in:
Yang Hau
2024-07-28 01:55:07 +08:00
parent 5ab27330e9
commit 7d114bf4d5
2 changed files with 34 additions and 8 deletions

View File

@@ -24,6 +24,18 @@ fn test_existing_file() {
ucmd.arg("a.txt").succeeds().stdout_is("A enil\nB enil");
}
#[test]
fn test_zero() {
let (at, mut ucmd) = at_and_ucmd!();
at.write("a.txt", "line A\0line B");
ucmd.arg("a.txt")
.arg("--zero")
.succeeds()
.stdout_is("A enil\0B enil");
}
#[test]
fn test_multiple_files() {
let (at, mut ucmd) = at_and_ucmd!();