From: Marius Gavrilescu Date: Sat, 30 Dec 2017 17:30:32 +0000 (+0200) Subject: Better tests X-Git-Tag: 0.001002~1 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=0ca5f5593440131c7d3a7010cad05d2ea28bed95;p=convert-base91.git Better tests --- diff --git a/t/Convert-Base91.t b/t/Convert-Base91.t index 01edc35..7f5489f 100644 --- a/t/Convert-Base91.t +++ b/t/Convert-Base91.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 9; BEGIN { use_ok('Convert::Base91', qw/encode_base91 decode_base91/) }; is encode_base91("Hello, World!\n"), '>OwJh>}AQ;r@@Y?FF', 'encode'; @@ -22,3 +22,8 @@ $base91->decode('>OwJh>}AQ'); $base91->decode(';r@@Y?FF'); my $decoded = $base91->decode_end; is $decoded, "Hello, World!\n", 'OO decode'; + +is $base91->decode_end, '', 'double decode_end'; +is $base91->encode_end, '', 'encode_end without data'; + +is decode_base91(">\x00OwJh\x01>}A\xFE\xDDQ;r@\@Y?FF\x05"), "Hello, World!\n", 'decode with junk';