File: ppi_token.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 (18 lines) | stat: -rwxr-xr-x 457 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

# Unit testing for PPI::Token

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

use PPI ();

MODIFICATION: {
	my $one = PPI::Token->new( "" );
	is $one->length, 0, "empty token has no length";
	ok $one->add_content( "abcde" ), "can add strings";
	is $one->length, 5, "adding actually adds";
	ok $one->set_content( "abc" ), "can set content";
	is $one->length, 3, "setting overwrites";
}