diff options
author | Niels Thykier <niels@thykier.net> | 2016-07-31 18:29:50 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2016-07-31 18:29:50 +0000 |
commit | 7a2344b85c6e3adc0b286163fc2446895be8184e (patch) | |
tree | 659bdb1b55757a038916095610cce8152b9bde2e /t/maintscript.t | |
parent | f7d8a068eb3394e76409535c8ebb7ab04758ef35 (diff) | |
download | debhelper-7a2344b85c6e3adc0b286163fc2446895be8184e.tar.gz |
t/maintscript.t: Rename + Mark as executable
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 't/maintscript.t')
-rwxr-xr-x | t/maintscript.t | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/maintscript.t b/t/maintscript.t new file mode 100755 index 00000000..e15daea3 --- /dev/null +++ b/t/maintscript.t @@ -0,0 +1,28 @@ +#!/usr/bin/perl +use strict; +use warnings; +use Test; +plan(tests => 8); + +system("mkdir -p t/tmp/debian"); +system("cp debian/control t/tmp/debian"); +open(OUT, ">", "t/tmp/debian/maintscript") || die "$!"; +print OUT <<EOF; +rm_conffile /etc/1 +mv_conffile /etc/2 /etc/3 1.0-1 +EOF +close OUT; +system("echo 10 >> t/tmp/debian/compat"); +system("cd t/tmp && fakeroot ../../dh_installdeb"); +for my $script (qw{postinst preinst prerm postrm}) { + my @output=`cat t/tmp/debian/debhelper.$script.debhelper`; + ok(grep { m{^dpkg-maintscript-helper rm_conffile /etc/1 -- "\$\@"$} } @output); + ok(grep { m{^dpkg-maintscript-helper mv_conffile /etc/2 /etc/3 1\.0-1 -- "\$\@"$} } @output); +} +system("rm -rf t/tmp"); + +# Local Variables: +# indent-tabs-mode: t +# tab-width: 4 +# cperl-indent-level: 4 +# End: |