File: axis.t

package info (click to toggle)
libchart-clicker-perl 2.90-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 696 kB
  • sloc: perl: 4,379; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 862 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use Test::More;

BEGIN {
    use_ok('Chart::Clicker::Axis');
}
my $label = 'Foo';

# Exact tick_division_type by default
my $axis = Chart::Clicker::Axis->new(
    label => $label, orientation => 'vertical', position => 'left'
);

cmp_ok($axis->format_value(100), 'eq', '100', 'format_value (default format test)');

ok($axis->label eq $label, 'label');

ok($axis->show_ticks, 'Default show_ticks');
ok($axis->visible, 'Default visible');

my $showticks = 0;
$axis->show_ticks($showticks);
ok($axis->show_ticks == $showticks, 'show_ticks');

my $vis = 0;
$axis->visible($vis);
ok($axis->visible == $vis, 'visible');

ok(defined($axis->range), 'Has range');

my $lower = 0;
my $upper = 100;
$axis->range->lower($lower);
$axis->range->upper($upper);
ok($axis->range->lower == $lower, 'Lower value');
ok($axis->range->upper == $upper, 'Upper value');

done_testing;