Skip to content

Commit 9bf6fc8

Browse files
committed
Added test based on issue
1 parent d07780b commit 9bf6fc8

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tests/by-util/test_od.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use std::io::Read;
1010
#[cfg(target_os = "linux")]
1111
use std::path::Path;
12+
use regex::Regex;
1213

1314
use unindent::unindent;
1415
use uutests::util::TestScenario;
@@ -689,7 +690,7 @@ fn test_hex_offset() {
689690
00000000 00000000 00000000 00000000
690691
000010 00000000 00000000 00000000 00000000
691692
00000000 00000000 00000000 00000000
692-
00001F
693+
00001f
693694
",
694695
);
695696

@@ -1343,3 +1344,17 @@ fn test_write_error_dev_full() {
13431344
.code_is(1)
13441345
.stderr_contains("No space left on device");
13451346
}
1347+
1348+
#[test]
1349+
#[cfg(target_os = "linux")]
1350+
fn test_hex_lowercase() {
1351+
// Test verifies that the output hex byte offset is in lowercase
1352+
new_ucmd!()
1353+
.arg("-Ax")
1354+
.arg("-N16")
1355+
.arg("-j0xff0")
1356+
.arg("/dev/urandom")
1357+
.succeeds()
1358+
.no_stderr()
1359+
.stdout_matches(&Regex::new(r"^000ff0.*").unwrap());
1360+
}

0 commit comments

Comments
 (0)