Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

9 simple tests for lite.t

  • Loading branch information...
commit 077cd35a0b6c8a1edffeba49487f801758e6dc75 1 parent 9d7bcbc
giftnuss authored
Showing with 32 additions and 1 deletion.
  1. +32 −1 t/lite.t
View
33 t/lite.t
@@ -1,4 +1,4 @@
-use Test::More tests => 1;
+use Test::More tests => 10;
use warnings;
use strict;
@@ -7,6 +7,37 @@ use PDF::API2::Lite;
my $pdf = PDF::API2::Lite->new();
+isa_ok($pdf,'PDF::API2::Lite');
+
+# check return values for methods without arguments
+isa_ok($pdf->page,'PDF::API2::Lite');
+
+# check return value for method requireing aruments
+isa_ok($pdf->mediabox(100,100),'PDF::API2::Lite');
+
+# testing serializing (stringify)
+# this destroys something so further tests needs a refresh
+# this method also contains some code which is never executed?
+my $str = $pdf->saveas('-');
+my @lines = split/\x0a/ , $str;
+
+is($lines[0],"%PDF-1.4","PDF default version is 1.4 for PDF::API2::Lite");
+is($lines[-1],"%%EOF","correct ending eof sequence");
+
+
+$pdf = PDF::API2::Lite->new();
+
+my $font;
+$font = $pdf->corefont('Times-Roman');
+isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
+$font = $pdf->corefont('Times-Bold');
+isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
+$font = $pdf->corefont('Helvetica');
+isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
+$font = $pdf->corefont('ZapfDingbats');
+isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
+
+$pdf = PDF::API2::Lite->new();
# RT #58386
my $egstate = $pdf->create_egs();
is(ref($egstate), 'PDF::API2::Resource::ExtGState',
Please sign in to comment.
Something went wrong with that request. Please try again.