Skip to content

Commit

Permalink
convert to using t::lib::PPI::Test::Cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
moregan committed Dec 5, 2014
1 parent 99b058a commit efcec28
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions t/ppi_token_quote.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,15 @@
# Unit testing for PPI::Token::Quote

use t::lib::PPI::Test::pragmas;
use Test::More tests => 16;
use Test::More tests => 5;

use PPI;
use t::lib::PPI::Test::Cmp;


STRING: {
# Prove what we say in the ->string docs
my $Document = PPI::Document->new(\<<'END_PERL');
'foo'
"foo"
q{foo}
qq <foo>
END_PERL
isa_ok( $Document, 'PPI::Document' );

my $quotes = $Document->find('Token::Quote');
is( ref($quotes), 'ARRAY', 'Found quotes' );
is( scalar(@$quotes), 4, 'Found 4 quotes' );
foreach my $Quote ( @$quotes ) {
isa_ok( $Quote, 'PPI::Token::Quote');
can_ok( $Quote, 'string' );
is( $Quote->string, 'foo', '->string returns "foo" for '
. $Quote->content );
}
cmp_element( "'foo'", { isa=>'PPI::Token::Quote', string=>'foo' } );
cmp_element( '"foo"', { isa=>'PPI::Token::Quote', string=>'foo' } );
cmp_element( 'q{foo}', { isa=>'PPI::Token::Quote', string=>'foo' } );
cmp_element( 'qq <foo>', { isa=>'PPI::Token::Quote', string=>'foo' } );
}

0 comments on commit efcec28

Please sign in to comment.