mirror of
https://github.com/stephenenelson/convert-binhex.git
synced 2024-12-26 10:30:43 +00:00
Test going from bin to hex via file interface
This commit is contained in:
parent
175934de43
commit
ddb42995dc
32
t/bin_to_hex_file.t
Normal file
32
t/bin_to_hex_file.t
Normal file
@ -0,0 +1,32 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use autodie;
|
||||
|
||||
use Test::Most;
|
||||
use FindBin '$Bin';
|
||||
use File::Temp;
|
||||
use File::Compare;
|
||||
|
||||
use Convert::BinHex;
|
||||
|
||||
my $source_file = "$Bin/../testin/eyeball.gif";
|
||||
my $comparison = "$Bin/../testin/eyeball.gif.hqx";
|
||||
#my $comparison = "$Bin/../testin/hands_m.eps.hqx";
|
||||
|
||||
|
||||
my $hqx = Convert::BinHex->new();
|
||||
$hqx->filename('eyeball.gif');
|
||||
$hqx->type('????');
|
||||
$hqx->creator('????');
|
||||
$hqx->data( Path => $source_file );
|
||||
$hqx->resource( Data => '' );
|
||||
|
||||
my $tmp_fh = File::Temp->new();
|
||||
$hqx->encode($tmp_fh);
|
||||
$tmp_fh->flush();
|
||||
$tmp_fh->seek(0,0);
|
||||
|
||||
ok( compare( $tmp_fh, $comparison) == 0, "File is binary correct");
|
||||
|
||||
done_testing();
|
Loading…
Reference in New Issue
Block a user