added --plain functionality

This commit is contained in:
Mikhail Katychev authored and David Peter committed 2022-05-22 21:34:26 +02:00
1 parent e4f0e8a092
commit f7f7447994
4 files changed
+219 -82

No files matched your search

+61
View File
@@ -227,3 +227,64 @@ mod blocksize {
.failure();
}
}
mod display_settings {
use super::hexyl;
#[test]
fn plain() {
hexyl()
.arg("ascii")
.arg("--plain")
.assert()
.success()
.stdout(" 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 0a \n");
}
#[test]
fn no_chars() {
hexyl()
.arg("ascii")
.arg("--no-chars")
.arg("--color=never")
.assert()
.success()
.stdout(
"┌────────┬─────────────────────────┬─────────────────────────┐\n\
│00000000│ 30 31 32 33 34 35 36 37 ┊ 38 39 61 62 63 64 65 0a │\n\
└────────┴─────────────────────────┴─────────────────────────┘\n",
);
}
#[test]
fn no_position() {
hexyl()
.arg("ascii")
.arg("--no-position")
.arg("--color=never")
.assert()
.success()
.stdout(
"┌─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
│ 30 31 32 33 34 35 36 37 ┊ 38 39 61 62 63 64 65 0a │01234567┊89abcde_│\n\
└─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
);
}
// #[test]
// fn display_offset_and_skip() {
// hexyl()
// .arg("hello_world_elf64")
// .arg("--color=never")
// .arg("--display-offset=0x20")
// .arg("--skip=0x10")
// .arg("--length=0x10")
// .assert()
// .success()
// .stdout(
// "┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
// │00000030│ 02 00 3e 00 01 00 00 00 ┊ 00 10 40 00 00 00 00 00 │•0>0•000┊0•@00000│\n\
// └────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
// );
// }
}