|
#!/usr/bin/perl -w
my $temp = "temp.ps" ;
{
my $c = Chart::Gnuplot->new(
output => $temp ,
);
$c ->command( "set size squre 0.5" );
ok( &diff ( $c ->{_script}, "command_1.gp" ) == 0);
}
{
my $c = Chart::Gnuplot->new(
output => $temp ,
);
$c ->command([
"set size squre 0.5" ,
"set parametric" ,
]);
ok( &diff ( $c ->{_script}, "command_2.gp" ) == 0);
}
sub diff
{
my ( $f1 , $f2 ) = @_ ;
$f2 = "t/" . $f2 if (!-e $f2 );
open (F1, $f1 ) || return (1);
open (F2, $f2 ) || return (1);
my @c1 = <F1>;
my @c2 = <F2>;
close (F1);
close (F2);
return (0) if ( join ( "" , @c1 ) eq join ( "" , @c2 ));
return (1);
}
|