### ----------------------------------------------------
### -- Text::Plot
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: t/02-pareto-principle-plot-usage.rakutest
### ----------------------------------------------------
use v6.d;
use Test;

use lib '.';
use lib './lib';

use Text::Plot;

plan 5;

## 1
isa-ok text-pareto-principle-plot((^300).roll(30).List, width => 100, height => 30), Str, 'numeric vector call';

## 1
isa-ok text-pareto-principle-plot(('a'..'z').roll(30).List, width => 100, height => 30), Str, 'string vector call';

## 3
my @vec3 = ('a'..'z').roll(130).List;

my $tpres31 = text-pareto-principle-plot(@vec3.BagHash.values.Array, title => 'Random strings', width => 80):normalize;
my $tpres32 = text-pareto-principle-plot(@vec3, title => 'Random strings', width => 80):normalize;

is $tpres31, $tpres32, 'equivalence of string and tally calls';

## 4
my %hash4 = ('a'..'z').pick(200) Z=> (^100).pick(200);

isa-ok text-pareto-principle-plot(%hash4), Str, 'hash argument';

## 5
my @arr5 = (^1000).pick(200) Z (^100).pick(200);

isa-ok text-pareto-principle-plot(@arr5), Str, 'array of numeric pairs argument';


done-testing;


