Skip to content

Commit

Permalink
test:Added wide-format test.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Jun 11, 2024
1 parent 356645c commit 55cd45f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion t/03-to-wide-format-over-arrays.rakutest
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TBD...

)

plan 3;
plan 4;

## 1
ok @tblHeaders.isa(Array) and
Expand All @@ -40,4 +40,26 @@ is-deeply
@wfRes2.sort,
'wide-format equivalence between positional and optional calls';

##-----------------------------------------------------------
## 4
my @arr41 = ${:group("Cities"), :x(0), :y(<103/1822>)},
${:group("Cities"), :x(1), :y(<3659/32796>)},
${:group("Cities"), :x(2), :y(<1361/8199>)},
${:group("Cities"), :x(3), :y(<200/911>)},
${:group("Cities"), :x(4), :y(<971/3644>)};

my @arr42 = ${:group("Populations"), :x(0), :y(<18850511/132248859>)},
${:group("Populations"), :x(1), :y(<60157397/264497718>)},
${:group("Populations"), :x(2), :y(<13496497/44082953>)},
${:group("Populations"), :x(3), :y(<48896489/132248859>)},
${:group("Populations"), :x(4), :y(<36373957/88165906>)};

my @arrWide4 = to-wide-format([|@@arr41, |@arr42], <x>, <group>, <y>);

is
(@arrWide4.map(*<Cities>).all ~~ Numeric:D) && (@arrWide4.map(*<Populations>).all ~~ Numeric:D),
True,
"The original numeric values are still numeric after wide form conversation";


done-testing;

0 comments on commit 55cd45f

Please sign in to comment.