### ----------------------------------------------------
### -- Text::CSV
### -- Licenses: Artistic-2.0
### -- Authors: H.Merijn Brand (Tux)
### -- File: 43_binary.t
### ----------------------------------------------------
#!raku

use v6;
use Slang::Tuxic;

use Text::CSV;
use Test;

for (^64) {

    my $b = Buf.new (61, ^2048 .map ({ 256.rand.Int }));

    my $csv = Text::CSV.new;

    ok ((my Str $u = $b.decode ("utf8-c8")), "decode");

    ok ($csv.combine (1, $u, 3), "Combine");

    ok ((my $s = $csv.string), "String");

    ok ($csv.parse ($s), "Parse");

    is ($csv.fields[1].text.encode ("utf8-c8"), $b, "Data");
    }


