Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

9 simple tests for lite.t

  • Loading branch information...
commit 077cd35a0b6c8a1edffeba49487f801758e6dc75 1 parent 9d7bcbc
giftnuss authored

Showing 1 changed file with 32 additions and 1 deletion. Show diff stats Hide diff stats

  1. +32 1 t/lite.t
33 t/lite.t
... ... @@ -1,4 +1,4 @@
1   -use Test::More tests => 1;
  1 +use Test::More tests => 10;
2 2
3 3 use warnings;
4 4 use strict;
@@ -7,6 +7,37 @@ use PDF::API2::Lite;
7 7
8 8 my $pdf = PDF::API2::Lite->new();
9 9
  10 +isa_ok($pdf,'PDF::API2::Lite');
  11 +
  12 +# check return values for methods without arguments
  13 +isa_ok($pdf->page,'PDF::API2::Lite');
  14 +
  15 +# check return value for method requireing aruments
  16 +isa_ok($pdf->mediabox(100,100),'PDF::API2::Lite');
  17 +
  18 +# testing serializing (stringify)
  19 +# this destroys something so further tests needs a refresh
  20 +# this method also contains some code which is never executed?
  21 +my $str = $pdf->saveas('-');
  22 +my @lines = split/\x0a/ , $str;
  23 +
  24 +is($lines[0],"%PDF-1.4","PDF default version is 1.4 for PDF::API2::Lite");
  25 +is($lines[-1],"%%EOF","correct ending eof sequence");
  26 +
  27 +
  28 +$pdf = PDF::API2::Lite->new();
  29 +
  30 +my $font;
  31 +$font = $pdf->corefont('Times-Roman');
  32 +isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
  33 +$font = $pdf->corefont('Times-Bold');
  34 +isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
  35 +$font = $pdf->corefont('Helvetica');
  36 +isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
  37 +$font = $pdf->corefont('ZapfDingbats');
  38 +isa_ok($font,'PDF::API2::Resource::Font::CoreFont');
  39 +
  40 +$pdf = PDF::API2::Lite->new();
10 41 # RT #58386
11 42 my $egstate = $pdf->create_egs();
12 43 is(ref($egstate), 'PDF::API2::Resource::ExtGState',

0 comments on commit 077cd35

Please sign in to comment.
Something went wrong with that request. Please try again.