File: 05_pi_comment.t

package info (click to toggle)
libhtml-scrubber-perl 0.11-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 296 kB
  • ctags: 38
  • sloc: perl: 673; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 723 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
# perl Makefile.PL && nmake realclean && cls && perl Makefile.PL && nmake test

use strict;
use Test::More tests => 9;
BEGIN { $^W = 1 }

use_ok( 'HTML::Scrubber' );

my $s = HTML::Scrubber->new;
my $html = q[start <!--comment--> mid1 <?html pi> mid2 <?xml pi?> end];

isa_ok($s, 'HTML::Scrubber');

is( $s->comment, 0, 'comment off by default');
is( $s->process, 0, 'process off by default');
is( $s->scrub($html), 'start  mid1  mid2  end');


$s->comment(1);
is( $s->comment, 1, 'comment on');
is( $s->scrub($html), 'start <!--comment--> mid1  mid2  end', 'comment on');



$s->process(1);
is( $s->process, 1, 'process on');
is( $s->scrub($html), 'start <!--comment--> mid1 <?html pi> mid2 <?xml pi?> end', 'process on');