Skip to content

Commit cea5645

Browse files
committed
test Encoding register without alternative-names
1 parent fc1261e commit cea5645

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

S32-encoding/registry.t

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use Test;
22

3-
plan 14;
3+
plan 15;
44

55
ok Encoding::Registry.find('utf8') ~~ Encoding, 'Can find built-in utf8 encoding';
66
ok Encoding::Registry.find('utf-8') ~~ Encoding, 'Can find built-in utf-8 encoding';
@@ -53,3 +53,13 @@ throws-like { Encoding::Registry.find('utf-29') },
5353
X::Encoding::AlreadyRegistered, name => 'prime-enc',
5454
'Cannot register an encoding with an overlapping alternative name';
5555
}
56+
57+
{
58+
my class NoAlternativeNamesEncoding does Encoding {
59+
method name() { "this-encoding-not-taken" }
60+
method encoder() { die "NYI" }
61+
method decoder() { die "NYI" }
62+
}
63+
lives-ok { Encoding::Registry.register(NoAlternativeNamesEncoding) },
64+
"Encodings with no alternative names method can be registered";
65+
}

0 commit comments

Comments
 (0)