Created
April 13, 2016 14:26
-
-
Save Tux/eac2f0f8c380a8acfdd1ba8617de5204 to your computer and use it in GitHub Desktop.
test script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl6 | |
use v6; | |
use Test; | |
for ^32 { | |
say ""; | |
say $_; | |
my @data = ^20 .map({ 256.rand.Int }).list; | |
@data.unshift: 61; | |
#dd @data; | |
my $b = Buf.new(@data); | |
ok((my Str $u = $b.decode("utf8-c8")), "decode"); | |
my @back = $u.encode("utf8-c8").list; | |
#dd @back; | |
my $n = Buf.new(@back); | |
is-deeply($n, $b, "Data"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment