Skip to content

Commit efcec28

Browse files
committed
convert to using t::lib::PPI::Test::Cmp
1 parent 99b058a commit efcec28

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

Diff for: t/ppi_token_quote.t

+6-19
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,15 @@
33
# Unit testing for PPI::Token::Quote
44

55
use t::lib::PPI::Test::pragmas;
6-
use Test::More tests => 16;
6+
use Test::More tests => 5;
77

8-
use PPI;
8+
use t::lib::PPI::Test::Cmp;
99

1010

1111
STRING: {
1212
# Prove what we say in the ->string docs
13-
my $Document = PPI::Document->new(\<<'END_PERL');
14-
'foo'
15-
"foo"
16-
q{foo}
17-
qq <foo>
18-
END_PERL
19-
isa_ok( $Document, 'PPI::Document' );
20-
21-
my $quotes = $Document->find('Token::Quote');
22-
is( ref($quotes), 'ARRAY', 'Found quotes' );
23-
is( scalar(@$quotes), 4, 'Found 4 quotes' );
24-
foreach my $Quote ( @$quotes ) {
25-
isa_ok( $Quote, 'PPI::Token::Quote');
26-
can_ok( $Quote, 'string' );
27-
is( $Quote->string, 'foo', '->string returns "foo" for '
28-
. $Quote->content );
29-
}
13+
cmp_element( "'foo'", { isa=>'PPI::Token::Quote', string=>'foo' } );
14+
cmp_element( '"foo"', { isa=>'PPI::Token::Quote', string=>'foo' } );
15+
cmp_element( 'q{foo}', { isa=>'PPI::Token::Quote', string=>'foo' } );
16+
cmp_element( 'qq <foo>', { isa=>'PPI::Token::Quote', string=>'foo' } );
3017
}

0 commit comments

Comments
 (0)