mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-30 09:05:54 +00:00
improvement(lib): align string literals better for black-box tests
This commit is contained in:
1 parent
07cdc97e74
commit
8af8a94699
1 file changed
+9
-9
+9
-9
@@ -460,36 +460,36 @@ mod tests {
|
||||
#[test]
|
||||
fn empty_file_passes() {
|
||||
let input = io::empty();
|
||||
let expected_string =
|
||||
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||
let expected_string = "\
|
||||
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
|
||||
"
|
||||
.to_owned();
|
||||
.to_owned();
|
||||
assert_print_all_output(input, expected_string);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn short_input_passes() {
|
||||
let input = io::Cursor::new(b"spam");
|
||||
let expected_string =
|
||||
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||
let expected_string = "\
|
||||
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||
│00000000│ 73 70 61 6d ┊ │spam ┊ │
|
||||
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
|
||||
"
|
||||
.to_owned();
|
||||
.to_owned();
|
||||
assert_print_all_output(input, expected_string);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn display_offset() {
|
||||
let input = io::Cursor::new(b"spamspamspamspamspam");
|
||||
let expected_string =
|
||||
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||
let expected_string = "\
|
||||
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||
│deadbeef│ 73 70 61 6d 73 70 61 6d ┊ 73 70 61 6d 73 70 61 6d │spamspam┊spamspam│
|
||||
│deadbeff│ 73 70 61 6d ┊ │spam ┊ │
|
||||
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
|
||||
"
|
||||
.to_owned();
|
||||
.to_owned();
|
||||
|
||||
let mut output = vec![];
|
||||
let mut printer: Printer<Vec<u8>> =
|
||||
|
||||
Reference in new issue
Block a user