### ----------------------------------------------------
### -- Arithmetic::PaperAndPencil
### -- Licenses: Artistic-2.0
### -- Authors: Jean Forget
### -- File: xt/05-action-csv.rakutest
### ----------------------------------------------------
# -*- encoding: utf-8; indent-tabs-mode: nil -*-

use Test;
use Arithmetic::PaperAndPencil;

plan 24;

my Arithmetic::PaperAndPencil::Action $action;

$action .= new-from-csv(csv => '0;MUL01;6;2;12;0;1;6;False;2;7;2;Bool::False;1;3;1;2;4;2');
is($action.level, 0);
is($action.label, 'MUL01');
is($action.r1l  , 0);
is($action.r1c  , 1);
is($action.r1str, False);
is($action.r2val, '2');
is($action.r2str, False);
is($action.w1val, '1');
is($action.csv  , '0;MUL01;6;2;12;0;1;6;False;2;7;2;False;1;3;1;2;4;2');

$action .= new-from-csv(csv => '0;WRI05;1884;;;99;99;xxx;True;99;99;xxx;Bool::True;4;4;1884;;;');
is($action.level, 0);
is($action.label, 'WRI05');
is($action.r1l  , 99);
is($action.r1c  , 99);
is($action.r1str, True);
is($action.r2val, 'xxx');
is($action.r2str, True);
is($action.w1val, '1884');
is($action.w2val, '');
is($action.csv  , '0;WRI05;1884;;;99;99;xxx;True;99;99;xxx;True;4;4;1884;0;0;');

$action .= new-from-csv(csv => '1;DRA01;;;;;;;;;;;;1;6;;6;1;');
is($action.level, 1);
is($action.label, 'DRA01');
is($action.w1l  , 1);
is($action.w1c  , 6);
is($action.csv  , '1;DRA01;;;;0;0;;False;0;0;;False;1;6;;6;1;');

done-testing;


