Skip to content

Commit b12aba8

Browse files
committed
encode_entities: add tests for escaped character classes
1 parent 6ed3402 commit b12aba8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/entities.t

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use warnings;
33
use utf8;
44

55
use HTML::Entities qw(decode_entities encode_entities encode_entities_numeric);
6-
use Test::More tests => 29;
6+
use Test::More tests => 31;
77

88
my $x = "Våre norske tegn bør &#230res";
99

@@ -48,6 +48,10 @@ is(encode_entities($x, '[:lower:][:digit:]'), "<V&aring;&#114;&#101;&#49;&#50;&#
4848
is(encode_entities($x, '=[:^ascii:]<>'), "&lt;V&aring;re123[&#61;]");
4949
is(encode_entities($x, '[:Vlower:]'), "<&#86;å&#114;&#101;123&#91;=&#93;");
5050

51+
# escaped character classes
52+
is(encode_entities($x, '\d'), "<Våre&#49;&#50;&#51;[=]");
53+
is(encode_entities($x, '\d[:punct:]'), "&lt;Våre&#49;&#50;&#51;&#91;&#61;&#93;");
54+
5155
# See how well it does against rfc1866...
5256
my $ent = '';
5357
my $plain = '';

0 commit comments

Comments
 (0)