gimppod.t 1.16 KB
Newer Older
Ed J's avatar
Ed J committed
1
use Test::More;
2
$Gimp::verbose = $Gimp::verbose = 0; # normally done in Gimp.pm
Ed J's avatar
Ed J committed
3 4 5 6
require Gimp::Pod;

my $p = Gimp::Pod->new;
ok($p, 'obj init');
Ed J's avatar
Ed J committed
7 8
is_deeply(
  [ $p->sections ],
Ed J's avatar
Ed J committed
9 10
  [ 'NAME', 'SPACE NAME', 'VERBATIM', 'TEMPORARY PROCEDURES', 'OTHER' ],
  'sections'
Ed J's avatar
Ed J committed
11
);
Ed J's avatar
Ed J committed
12
is($p->section('NAME'), 'test - Run some tests', 'sect name');
Ed J's avatar
Ed J committed
13 14 15 16 17 18 19 20 21 22
is(
  $p->section('SPACE NAME'),
  "Some bold text.\n\nSecond para.",
  'sect space-name'
);
is(
  $p->section('VERBATIM'),
  " verbatim\n verbatim2 \n\n new verbatim para",
  'sect verbatim'
);
Ed J's avatar
Ed J committed
23
is($p->section('OTHER'), 'Other text.', 'sect at eof');
24
is($p->section('NOT THERE'), undef, 'sect not there');
Ed J's avatar
Ed J committed
25 26 27 28 29 30 31 32 33 34
is_deeply(
  [ $p->sections('TEMPORARY PROCEDURES') ],
  [ 'p1 - text', 'p2 - other' ],
  'sub-sections'
);
is(
  $p->section('TEMPORARY PROCEDURES', 'p1 - text', 'PARAMETERS'),
  ' p1 params',
  'sub-section'
);
Ed J's avatar
Ed J committed
35 36 37 38 39 40 41 42

done_testing;
__END__

=head1 NAME

test - Run some tests

Ed J's avatar
Ed J committed
43 44
=head1 SPACE NAME

Ed J's avatar
Ed J committed
45 46 47
Some B<bold> text.

Second para.
Ed J's avatar
Ed J committed
48

Ed J's avatar
Ed J committed
49 50 51 52 53
=head1 VERBATIM

 verbatim
 verbatim2 

Ed J's avatar
Ed J committed
54 55
 new verbatim para

Ed J's avatar
Ed J committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
=head1 TEMPORARY PROCEDURES

=head2 p1 - text

p1 description.

=head3 PARAMETERS

 p1 params

=head3 SYNOPSIS

<Image>/Menu

=head2 p2 - other

Ed J's avatar
Ed J committed
72 73 74
=head1 OTHER

Other text.