Permalink
Browse files

added test for context with columns

  • Loading branch information...
pvinis pvinis
pvinis authored and pvinis committed Oct 25, 2012
1 parent 3e498f7 commit 639bd6acf85f215f35c31dfea6b5ca076548af87
Showing with 26 additions and 0 deletions.
  1. +26 −0 t/context.t
View
@@ -225,3 +225,29 @@ EOF
ack_lists_match( [ @args, @files ], \@expected, 'Context is disabled with -o' );
}
+
+WITH_COLUMNS_AND_CONTEXT: {
+ my @expected = split( /\n/, <<'HERE' );
+8-See, half the world sees the myth as fact, and it's seen as a lie by the other half
+9-And the simple truth is that it's none of that 'cause
+10:1:Somehow no matter what the world keeps turning
+11:1:Somehow we get by without ever learning
+12-
+13-Science and religion are not mutually exclusive
+--
+21-'cause some things are better left without a doubt
+22-And if it works, then it gets the job done
+23:1:Somehow no matter what the world keeps turning
+24:1:Somehow we get by without ever learning
+25-
+26- -- "The Science Of Myth", Screeching Weasel
+HERE
+ my $weasel = File::Next::reslash( 't/text/science-of-myth.txt' );
+ my @files = ( $weasel );
+ @expected = map { "${weasel}:$_" } @expected;
+
+ my @args = qw( somehow -w -i --noenv --type=text --column -C2 );
+ my @results = run_ack( @args, @files );
+
+ lists_match( \@results, \@expected, 'Checking context with column numbers' );
+}

0 comments on commit 639bd6a

Please sign in to comment.