File: rt72659_utf8.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 (29 lines) | stat: -rw-r--r-- 779 bytes parent folder | download | duplicates (6)
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
# Tests related to RG72659 - https://rt.cpan.org/Public/Bug/Display.html?id=72659
#
# I was unable to reproduce the errors described, but am leaving this in
# place for now as it will catch any future issues with utf8 disjoints.
#
use strict;
use utf8;
use File::Spec;
use Test::More;

use_ok('HTML::Scrubber');

use HTML::Scrubber;

my $source = "\x{DF}";
utf8::upgrade($source);

ok( utf8::is_utf8($source), 'Source string is marked UTF8' );
ok( utf8::valid($source),   'Source string is valid UTF8' );

# scrub it
my $scrubber = HTML::Scrubber->new();
my $result   = $scrubber->scrub($source);

ok( utf8::is_utf8($result), 'Result string is marked UTF8' );
ok( utf8::valid($result),   'Result string is valid UTF8' );
is( $source, $result, 'Result = Source' );

done_testing;