image names from OO conversion aren't consistent
[HTML-AutoConvert.git] / t / 34-doc_images-OpenOffice.t
1 #!perl
2
3 BEGIN { chomp($pwd=`pwd`); $ENV{PATH} .= ":$pwd/bin"; };
4
5 use Test::More tests => 5;
6
7 use HTML::AutoConvert;
8
9 my $c = new HTML::AutoConvert;
10
11 my $force = 'OpenOffice';
12 #$c->{'handlers'}{'doc'}{$force}{'weight'} = -1;
13 my @del = grep { $_ ne $force } keys %{ $c->{'handlers'}{'doc'} };
14 delete($c->{'handlers'}{'doc'}{$_}) foreach @del;
15
16 my( $html, @images ) = $c->html_convert('t/HeatherElko.doc');
17
18 ok( scalar(@images) == 2, 'got two images' );
19
20 #save em off
21 #foreach my $image (@images) {
22 #  my( $file, $data) = @$image;
23 #  open(FILE, ">t/$file") or die $!;
24 #  print FILE $data;
25 #  close FILE or die $!;
26 #}
27
28 #check the names & lengths at least
29 #well, the names don't appear to be consistent, but we can check they're png
30 like( $images[0]->[0], qr/^[0-9A-F]+.png$/, '1st image name');
31 ok( length($images[0]->[1]) == 8704, '1st image size');
32
33 like( $images[0]->[0], qr/^[0-9A-F]+.png$/, '2nd image name');
34 ok( length($images[1]->[1]) == 2125, '2nd image size');
35
36