File: ppi_token_pod.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-- 740 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 => 4;

# =begin testing merge after PPI::Node 4
{
# Create the test fragments
my $one = PPI::Token::Pod->new("=pod\n\nOne\n\n=cut\n");
my $two = PPI::Token::Pod->new("=pod\n\nTwo");
isa_ok( $one, 'PPI::Token::Pod' );
isa_ok( $two, 'PPI::Token::Pod' );

# Create the combined Pod
my $merged = PPI::Token::Pod->merge($one, $two);
isa_ok( $merged, 'PPI::Token::Pod' );
is( $merged->content, "=pod\n\nOne\n\nTwo\n\n=cut\n", 'Merged POD looks ok' );
}


1;