### ----------------------------------------------------
### -- Text::Plot
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: t/01-basic-usage.rakutest
### ----------------------------------------------------
use v6.d;
use Test;

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

use Text::Plot;

plan 8;

## 1
isa-ok text-list-plot((^30).List>>.sqrt, width => 100, height => 30), Str, 'no y-values';

## 2
my @xs = (0, 0.4 ... 5).List;
isa-ok text-list-plot(@xs, @xs>>.sin, width => 100, height => 30, x-label => 'some range'),
        Str,
        'with x- and y-values and x-label specs';

## 3
isa-ok
        text-list-plot(@xs, @xs>>.sqrt.map({ -$_ }).List,
                width => 100, height => 30,
                x-label => 'some range', y-label => 'sqrt value'),
        Str,
        'with x- and y-values and x- and y-label specs';


## 4
isa-ok text-list-plot(@xs, @xs>>.sqrt.map({ -$_ }).List, title => 'some title'),
        Str,
        'with title';


## 5
isa-ok text-list-plot( (^@xs.elems Z @xs).List, title => 'some list of pairs'),
        Str,
        'list of two-element lists';

## 6
isa-ok
        text-list-plot(@xs, @xs>>.sqrt.map({ -$_ }).List,
                pointChar => '·',
                width => 100, height => 30,
                xLabel => 'some range', yLabel => 'sqrt value'),
        Str,
        'x- and y-values with point character, x- and y-label alias specs';

## 7
isa-ok (((^10) Z (^10)) ==> text-list-plot), Str;

## 8
isa-ok (((^10) Z (^10)) ==> text-list-plot(width=>50)), Str;

done-testing;


