summaryrefslogtreecommitdiff
path: root/t/maintscript
diff options
context:
space:
mode:
Diffstat (limited to 't/maintscript')
-rw-r--r--t/maintscript19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/maintscript b/t/maintscript
new file mode 100644
index 0000000..bf15d44
--- /dev/null
+++ b/t/maintscript
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+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("cd t/tmp && DH_COMPAT=7 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");