Skip to content

Commit

Permalink
increase coverage by testing the templates
Browse files Browse the repository at this point in the history
  • Loading branch information
book committed Aug 11, 2005
1 parent eb4503b commit 35f1f37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion t/10foo.t
Expand Up @@ -14,8 +14,14 @@ ok( $capture[0] eq 'c', "Default captured field" );
ok( $foo->comments == 0, "Default comments" );

# check the format method
$foo = Regexp::Log::Foo->new();
ok( $foo->format('%a %b %c') eq '%a %b %c', "Format return new value" );
ok( $foo->format eq '%a %b %c', "new format value is set" );
my $r = $foo->regexp;

# check the format method with templates
$foo = Regexp::Log::Foo->new( format => ':default' );
is( $foo->regexp, $r, "Same regexp with ':default' and '%a %b %c'");

# check the fields method
my @fields = sort $foo->fields;
Expand Down Expand Up @@ -142,4 +148,4 @@ while (<>) {
is_deeply( \%data, $data[ $i++ ], "foo2.log line " . ( $i + 1 ) );
}

BEGIN { plan tests => 35 }
BEGIN { plan tests => 36 }

0 comments on commit 35f1f37

Please sign in to comment.