File: rules.t

package info (click to toggle)
dh-make-perl 0.116
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,212 kB
  • sloc: perl: 5,513; makefile: 34; sh: 17
file content (45 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/perl -w

use strict;
use warnings;

use Test::More tests => 8;

BEGIN {
    use_ok('Debian::Rules');
};

my $r = Debian::Rules->new(
    { lines => [ "#!/usr/bin/make -f\n", "%:\n", "\tdh \$\@\n" ] } );

is( @{ $r->lines  }, 3,  'lines initialized properly' );
ok( $r->is_dhtiny, "Detects simple dhtiny-style rules" );

$r = Debian::Rules->new(
    {   lines => [
            "#!/usr/bin/make -f\n",
            "%:\n",
            "\tdh \$\@ --with=quilt\n",
            "\n",
            "# something else goes here\n",
        ]
    }
);
ok( $r->is_dhtiny, "Detects dh in dhtiny+quilt" );
ok( $r->is_quiltified, "Detects --with=quilt" );
$r->drop_quilt;
is( $r->lines->[2], "\tdh \$\@\n", 'Dequiltification works' );
is( scalar @{ $r->lines }, 5, "Dequiltification doesn't cut lines" );

$r = Debian::Rules->new(
    {   lines => [
            "#!/usr/bin/make -f\n",
            "%:\n",
            "\tdh --with=quilt \$\@\n",
            "\n",
            "# something else goes here\n",
        ]
    }
);
$r->drop_quilt;
is( $r->lines->[2], "\tdh \$\@\n", 'Dequiltification works with --with=quilt in the middle' );