summaryrefslogtreecommitdiffabout
path: root/t
Side-by-side diff
Diffstat (limited to 't') (more/less context) (ignore whitespace changes)
-rw-r--r--t/09linemon.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/09linemon.t b/t/09linemon.t
new file mode 100644
index 0000000..1f1666a
--- a/dev/null
+++ b/t/09linemon.t
@@ -0,0 +1,35 @@
+# -*- perl -*-
+
+use lib 't', 'lib';
+
+use strict;
+use warnings;
+use TestCapture;
+use Test::More tests => 3;
+
+our($catbin, $input, $content);
+
+my @lines;
+
+TestCapture({ argv => [$catbin, $input],
+ stdout => sub { push @lines, shift } });
+
+is($content, join('', @lines));
+
+@lines = ();
+
+TestCapture({ argv => [$catbin, '-l', 31, $input],
+ stdout => sub { push @lines, shift } });
+
+is_deeply(\@lines, ['CHAPTER I. Down the Rabbit-Hole']);
+
+@lines = ();
+
+TestCapture({ argv => [$catbin, '-l', 102, $input],
+ stdout => sub { push @lines, shift } });
+
+is_deeply(\@lines, [ "CHAPTER I. Down the Rabbit-Hole\n",
+ "\n",
+ 'Alice was beginning to get very tired of sitting by her sister on the' ]);
+
+

Return to:

Send suggestions and report system problems to the System administrator.