Skip to content

Commit

Permalink
die on niy encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
sergot committed Jul 17, 2014
1 parent 6538f63 commit 6a1bb99
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Encode.pm6
Expand Up @@ -10,6 +10,7 @@ my %encodings =
;

our sub decode($encoding, buf8 $buf) {
die "$encoding NIY" unless %encodings{$encoding}.defined;
&(%encodings{$encoding})($buf);
}

Expand Down
9 changes: 9 additions & 0 deletions t/01-basic.t
@@ -0,0 +1,9 @@
use v6;
use Encode;

use Test;

plan 1;

Encode::decode("niy-encoding", buf8.new(97));
dies_ok { Encode::decode("niy-encoding", buf8.new(97)) }, 'dies if NIY';
File renamed without changes.

0 comments on commit 6a1bb99

Please sign in to comment.