File: 03_empiric.t

package info (click to toggle)
libppi-perl 1.203-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,576 kB
  • ctags: 603
  • sloc: perl: 10,139; makefile: 43
file content (33 lines) | stat: -rw-r--r-- 652 bytes parent folder | download
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
#!/usr/bin/perl

# Formal testing for PPI

# This does an empiric test that when we try to parse something,
# something ( anything ) comes out the other side.

use strict;
use File::Spec::Functions ':ALL';
BEGIN {
	$| = 1;
	$PPI::XS_DISABLE = 1;
	$PPI::XS_DISABLE = 1; # Prevent warning
}
use PPI;

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

my $testdir = catdir( 't', 'data', '03_empiric' );



# Get the lexer
my $Lexer = PPI::Lexer->new;
ok( $Lexer, 'PPI::Lexer->new() returns true' );
isa_ok( $Lexer, 'PPI::Lexer' );

# Parse a file
my $Document = $Lexer->lex_file( catfile( $testdir, 'test.dat' ) );
isa_ok( $Document, 'PPI::Document' );

1;