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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/usr/bin/perl -w
use strict;
use Test::More (tests => 4);
BEGIN {use Chart::Gnuplot;}
my $temp = "temp.ps";
# Test setting the orientation
{
my $c = Chart::Gnuplot->new(
output => $temp,
orient => 'portrait',
);
$c->_setChart();
ok($c->{terminal} =~ /portrait$/);
}
# Test setting image size
{
my $c = Chart::Gnuplot->new(
output => $temp,
imagesize => "0.9, 1.1",
);
$c->_setChart();
ok($c->{terminal} =~ /size 9,7\.7$/);
}
# Test setting image size of portrait image
{
my $c = Chart::Gnuplot->new(
output => $temp,
orient => 'portrait',
imagesize => "0.9, 1.1",
);
$c->_setChart();
ok($c->{terminal} =~ /portrait size 6\.3,11$/);
}
# Test setting image size with specified unit
{
my $c = Chart::Gnuplot->new(
output => $temp,
imagesize => "18 cm, 4 inches",
);
$c->_setChart();
ok($c->{terminal} =~ /size 18 cm,4 inches$/);
}
|