File: ppi_token_quote_interpolate.t

package info (click to toggle)
libppi-perl 1.215-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,820 kB
  • sloc: perl: 12,129; makefile: 8
file content (34 lines) | stat: -rw-r--r-- 976 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl

# Unit testing for PPI, generated by Test::Inline

use strict;
use File::Spec::Functions ':ALL';
BEGIN {
	$|  = 1;
	$^W = 1;
	no warnings 'once';
	$PPI::XS_DISABLE = 1;
	$PPI::Lexer::X_TOKENIZER ||= $ENV{X_TOKENIZER};
}
use PPI;

# Execute the tests
use Test::More tests => 8;

# =begin testing string 8
{
my $Document = PPI::Document->new( \"print qq{foo}, qq!bar!, qq <foo>;" );
isa_ok( $Document, 'PPI::Document' );
my $Interpolate = $Document->find('Token::Quote::Interpolate');
is( scalar(@$Interpolate), 3, '->find returns three objects' );
isa_ok( $Interpolate->[0], 'PPI::Token::Quote::Interpolate' );
isa_ok( $Interpolate->[1], 'PPI::Token::Quote::Interpolate' );
isa_ok( $Interpolate->[2], 'PPI::Token::Quote::Interpolate' );
is( $Interpolate->[0]->string, 'foo', '->string returns as expected' );
is( $Interpolate->[1]->string, 'bar', '->string returns as expected' );
is( $Interpolate->[2]->string, 'foo', '->string returns as expected' );
}


1;