File: 10_statement.t

package info (click to toggle)
libppi-perl 1.281-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,220 kB
  • sloc: perl: 15,287; makefile: 8
file content (35 lines) | stat: -rwxr-xr-x 681 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
35
#!/usr/bin/perl

# Test the various PPI::Statement packages

use lib 't/lib';
use PPI::Test::pragmas;
use Test::More tests => 7 + ($ENV{AUTHOR_TESTING} ? 1 : 0);

use PPI ();
use Helper 'safe_new';





#####################################################################
# Basic subroutine test

SCOPE: {
	my $doc = safe_new \"sub foo { 1 }";
	isa_ok( $doc->child(0), 'PPI::Statement::Sub' );
}





#####################################################################
# Regression test, make sure utf8 is a pragma

SCOPE: {
	my $doc = safe_new \"use utf8;";
	isa_ok( $doc->child(0), 'PPI::Statement::Include' );
	is( $doc->child(0)->pragma, 'utf8', 'use utf8 is a pragma' );
}