| File: | Dpkg/Control/Tests.pm |
| Coverage: | 94.6% |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | # Copyright © 2016 Guillem Jover <guillem@debian.org> | ||||||
| 2 | # | ||||||
| 3 | # This program is free software; you can redistribute it and/or modify | ||||||
| 4 | # it under the terms of the GNU General Public License as published by | ||||||
| 5 | # the Free Software Foundation; either version 2 of the License, or | ||||||
| 6 | # (at your option) any later version. | ||||||
| 7 | # | ||||||
| 8 | # This program is distributed in the hope that it will be useful, | ||||||
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||
| 11 | # GNU General Public License for more details. | ||||||
| 12 | # | ||||||
| 13 | # You should have received a copy of the GNU General Public License | ||||||
| 14 | # along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||||
| 15 | |||||||
| 16 | =encoding utf8 | ||||||
| 17 | |||||||
| 18 - 27 | =head1 NAME Dpkg::Control::Tests - parse files like debian/tests/control =head1 DESCRIPTION It provides a class to access data of files that follow the same syntax as F<debian/tests/control>. =cut | ||||||
| 28 | |||||||
| 29 | package Dpkg::Control::Tests 1.00; | ||||||
| 30 | |||||||
| 31 | 3 3 3 | 7 3 42 | use strict; | ||||
| 32 | 3 3 3 | 4 2 77 | use warnings; | ||||
| 33 | |||||||
| 34 | 3 3 3 | 375 4 147 | use Dpkg::Control; | ||||
| 35 | 3 3 3 | 456 3 66 | use Dpkg::Control::Tests::Entry; | ||||
| 36 | 3 3 3 | 686 10 164 | use Dpkg::Index; | ||||
| 37 | |||||||
| 38 | 3 3 3 | 15 5 14 | use parent qw(Dpkg::Index); | ||||
| 39 | |||||||
| 40 - 51 | =head1 METHODS All the methods of L<Dpkg::Index> are available. Those listed below are either new or overridden with a different behavior. =over 4 =item $c = Dpkg::Control::Tests->new(%opts) Create a new Dpkg::Control::Tests object, which inherits from L<Dpkg::Index>. =cut | ||||||
| 52 | |||||||
| 53 | sub new { | ||||||
| 54 | 9 | 1 | 17 | my ($this, %opts) = @_; | |||
| 55 | 9 | 59 | my $class = ref($this) || $this; | ||||
| 56 | 9 | 40 | my $self = Dpkg::Index->new(type => CTRL_TESTS, %opts); | ||||
| 57 | |||||||
| 58 | 9 | 18 | return bless $self, $class; | ||||
| 59 | } | ||||||
| 60 | |||||||
| 61 - 65 | =item $item = $tests->new_item() Creates a new item. =cut | ||||||
| 66 | |||||||
| 67 | sub new_item { | ||||||
| 68 | 36 | 1 | 29 | my $self = shift; | |||
| 69 | |||||||
| 70 | 36 | 74 | return Dpkg::Control::Tests::Entry->new(); | ||||
| 71 | } | ||||||
| 72 | |||||||
| 73 | =back | ||||||
| 74 | |||||||
| 75 - 81 | =head1 CHANGES =head2 Version 1.00 (dpkg 1.18.8) Mark the module as public. =cut | ||||||
| 82 | |||||||
| 83 | 1; | ||||||