summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBalaji Sivaraman <balaji@balajisivaraman.com>2018-01-01 19:30:31 +0530
committerAndrew Gallant <jamslam@gmail.com>2018-01-01 09:00:31 -0500
commitba1023e1e45d7bd6edffa43d06c9613d3b84de8f (patch)
tree4fee4b0b3ef368344713e5fcac8e75593337d543 /tests
parent5e73075ef5300fdec03f6c4685750788108b00f4 (diff)
printer: add support for line number alignment
Closes #544
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index 0c5b4daf..152eca30 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -103,6 +103,22 @@ sherlock!(line_numbers, |wd: WorkDir, mut cmd: Command| {
assert_eq!(lines, expected);
});
+sherlock!(line_number_width, |wd: WorkDir, mut cmd: Command| {
+ cmd.arg("-n");
+ cmd.arg("--line-number-width").arg("2");
+ let lines: String = wd.stdout(&mut cmd);
+ let expected = " 1:For the Doctor Watsons of this world, as opposed to the Sherlock
+ 3:be, to a very large extent, the result of luck. Sherlock Holmes
+";
+ assert_eq!(lines, expected);
+});
+
+sherlock!(line_number_width_padding_character_error, |wd: WorkDir, mut cmd: Command| {
+ cmd.arg("-n");
+ cmd.arg("--line-number-width").arg("02");
+ wd.assert_non_empty_stderr(&mut cmd);
+});
+
sherlock!(columns, |wd: WorkDir, mut cmd: Command| {
cmd.arg("--column");
let lines: String = wd.stdout(&mut cmd);