Parent Directory | Revision Log
fix ' and " quoting, as well as patterns which begin with - and test it
1 | #!/usr/bin/perl |
2 | use strict; |
3 | use warnings; |
4 | |
5 | my $debug = @ARGV ? 1 : 0; |
6 | |
7 | use Test::More tests => 13; |
8 | use lib 'lib'; |
9 | |
10 | use Data::Dump qw/dump/; |
11 | |
12 | BEGIN { |
13 | use_ok('Frey::Shell::Grep'); |
14 | } |
15 | |
16 | my $param = { |
17 | request_url => '/', |
18 | debug => $debug, |
19 | }; |
20 | |
21 | sub test_grep { |
22 | my $pattern = shift; |
23 | $param->{pattern} = $pattern if $pattern; |
24 | diag $pattern; |
25 | ok( my $o = Frey::Shell::Grep->new( %$param ), 'new' ); |
26 | ok( my $markup = $o->as_markup, 'as_markup' ); |
27 | diag $markup if $debug; |
28 | like( $markup, qr{$pattern}, "markup like $pattern" ); |
29 | } |
30 | |
31 | test_grep; # 'FIXME'; |
32 | test_grep '->html'; |
33 | test_grep '"can"'; |
34 | test_grep "'text"; |
35 |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.26 |