summaryrefslogtreecommitdiff
path: root/t/dh-lib
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2012-09-09 14:28:51 -0400
committerJoey Hess <joey@kitenet.net>2012-09-09 14:29:26 -0400
commit073034791eea9df519a06deb4058908e30d0fa7d (patch)
tree579c525c079efe0e1b50621e10f5055a6ba42f3a /t/dh-lib
parentf7c9099e88846f7c117aa592f5119911f03e71e5 (diff)
parent37de53703877f57f1604038706a7dce3e292c3ad (diff)
Merge branch 'wheezy'
Diffstat (limited to 't/dh-lib')
-rwxr-xr-xt/dh-lib31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/dh-lib b/t/dh-lib
new file mode 100755
index 0000000..772b1a1
--- /dev/null
+++ b/t/dh-lib
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+package Debian::Debhelper::Dh_Lib::Test;
+use strict;
+use warnings;
+use Test::More;
+
+plan(tests => 10);
+
+use_ok('Debian::Debhelper::Dh_Lib');
+
+sub ok_autoscript_result {
+ ok(-f 'debian/testpackage.postinst.debhelper');
+ open(F, 'debian/testpackage.postinst.debhelper') or die;
+ my (@c) = <F>;
+ close(F) or die;
+ like(join('',@c), qr{update-rc\.d test-script test parms with"quote >/dev/null});
+}
+
+ok(unlink('debian/testpackage.postinst.debhelper') >= 0);
+
+ok(autoscript('testpackage', 'postinst', 'postinst-init',
+ 's/#SCRIPT#/test-script/g; s/#INITPARMS#/test parms with\\"quote/g'));
+ok_autoscript_result;
+
+ok(unlink('debian/testpackage.postinst.debhelper') >= 0);
+
+ok(autoscript('testpackage', 'postinst', 'postinst-init',
+ sub { s/#SCRIPT#/test-script/g; s/#INITPARMS#/test parms with"quote/g } ));
+ok_autoscript_result;
+
+ok(unlink('debian/testpackage.postinst.debhelper') >= 0);