File: 23_file.t

package info (click to toggle)
libppi-perl 1.283-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,216 kB
  • sloc: perl: 15,295; makefile: 8
file content (29 lines) | stat: -rwxr-xr-x 632 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl

# Testing of PPI::Document::File

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

use File::Spec::Functions qw( catfile );
use PPI::Document::File ();





#####################################################################
# Creating Documents

SCOPE: {
	# From a specific file
	my $file = catfile('t', 'data', 'basic.pl');
	ok( -f $file, 'Found test file' );

	# Load from the file
	my $doc = PPI::Document::File->new( $file );
	isa_ok( $doc, 'PPI::Document::File' );
	isa_ok( $doc, 'PPI::Document'       );
	is( $doc->filename, $file, '->filename ok' );
}