summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/01-doc.t2
-rw-r--r--t/34-doc_images-OpenOffice.t35
-rw-r--r--t/46-pdf_images-poppler.t38
-rw-r--r--t/HeatherElko.docbin0 -> 36864 bytes
4 files changed, 75 insertions, 0 deletions
diff --git a/t/01-doc.t b/t/01-doc.t
index cbb8286..a2a788d 100644
--- a/t/01-doc.t
+++ b/t/01-doc.t
@@ -1,5 +1,7 @@
#!perl
+BEGIN { chomp($pwd=`pwd`); $ENV{PATH} .= ":$pwd/bin"; };
+
use Test::More tests => 2;
use HTML::AutoConvert;
diff --git a/t/34-doc_images-OpenOffice.t b/t/34-doc_images-OpenOffice.t
new file mode 100644
index 0000000..ba32b2d
--- /dev/null
+++ b/t/34-doc_images-OpenOffice.t
@@ -0,0 +1,35 @@
+#!perl
+
+BEGIN { chomp($pwd=`pwd`); $ENV{PATH} .= ":$pwd/bin"; };
+
+use Test::More tests => 5;
+
+use HTML::AutoConvert;
+
+my $c = new HTML::AutoConvert;
+
+my $force = 'OpenOffice';
+#$c->{'handlers'}{'doc'}{$force}{'weight'} = -1;
+my @del = grep { $_ ne $force } keys %{ $c->{'handlers'}{'doc'} };
+delete($c->{'handlers'}{'doc'}{$_}) foreach @del;
+
+my( $html, @images ) = $c->html_convert('t/HeatherElko.doc');
+
+ok( scalar(@images) == 2, 'got two images' );
+
+#save em off
+#foreach my $image (@images) {
+# my( $file, $data) = @$image;
+# open(FILE, ">t/$file") or die $!;
+# print FILE $data;
+# close FILE or die $!;
+#}
+
+#check the names & lengths at least
+is( $images[0]->[0], '10000000000000C80000009688B0FEF3.png', '1st image name');
+ok( length($images[0]->[1]) == 8704, '1st image size');
+
+is( $images[1]->[0], '100000000000009D0000009F54B4BCB3.png', '2nd image name');
+ok( length($images[1]->[1]) == 2125, '2nd image size');
+
+
diff --git a/t/46-pdf_images-poppler.t b/t/46-pdf_images-poppler.t
new file mode 100644
index 0000000..9bc1fc1
--- /dev/null
+++ b/t/46-pdf_images-poppler.t
@@ -0,0 +1,38 @@
+#!perl
+
+use Test::More tests => 9;
+
+use HTML::AutoConvert;
+
+my $c = new HTML::AutoConvert;
+
+my $force = 'poppler';
+#$c->{'handlers'}{'doc'}{$force}{'weight'} = -1;
+my @del = grep { $_ ne $force } keys %{ $c->{'handlers'}{'pdf'} };
+delete($c->{'handlers'}{'pdf'}{$_}) foreach @del;
+
+my( $html, @images ) = $c->html_convert('t/attitude.pdf');
+
+ok( scalar(@images) == 21, 'got 21 images' );
+
+#save em off
+#foreach my $image (@images) {
+# my( $file, $data) = @$image;
+# open(FILE, ">t/$file") or die $!;
+# print FILE $data;
+# close FILE or die $!;
+#}
+
+#check the names & lengths at least
+is( $images[0]->[0], '000.ppm', '1st image name');
+ok( length($images[0]->[1]) == 25949, '1st image size');
+
+is( $images[1]->[0], '001.ppm', '2nd image name');
+ok( length($images[1]->[1]) == 43664, '1st image size');
+
+is( $images[2]->[0], '002.ppm', '3rd image name');
+ok( length($images[2]->[1]) == 46833, '1st image size');
+
+is( $images[9]->[0], '009.ppm', '10th image name');
+ok( length($images[9]->[1]) == 46374, '10th image size');
+
diff --git a/t/HeatherElko.doc b/t/HeatherElko.doc
new file mode 100644
index 0000000..4af5af7
--- /dev/null
+++ b/t/HeatherElko.doc
Binary files differ