/[Frey]/trunk/t/30-Frey-Shell-Grep.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/30-Frey-Shell-Grep.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 840 - (hide annotations)
Sun Dec 14 23:10:23 2008 UTC (15 years, 5 months ago) by dpavlin
File MIME type: application/x-troff
File size: 607 byte(s)
fix ' and " quoting, as well as patterns which begin with - and test it
1 dpavlin 840 #!/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    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26