mirror of
https://github.com/uutils/grep.git
synced 2026-06-10 16:15:11 -07:00
test: cover -T line-number width on the file (not stdin) path
This commit is contained in:
@@ -626,6 +626,15 @@ fn line_number_and_byte_offset_prefixes() {
|
||||
.pipe_in("x\n")
|
||||
.succeeds()
|
||||
.stdout_contains("1:\tx\n");
|
||||
|
||||
// -T against a real file (not stdin): the line-number field width is
|
||||
// derived from the file size, which only happens on the `File` path in
|
||||
// `process_file` (src/searcher.rs), not the stdin path.
|
||||
let (scene, mut c) = ucmd();
|
||||
scene.fixtures.write("f", "x\n");
|
||||
c.args(&["-T", "-n", "x", "f"])
|
||||
.succeeds()
|
||||
.stdout_contains("1:\tx\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user