[debhelper-devel] [debhelper] 01/01: Update test to match previous commit
Niels Thykier
nthykier at moszumanska.debian.org
Sun Jan 14 10:24:08 UTC 2018
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit 685618e990559e95720681a67f542193544cdb9f
Author: Niels Thykier <niels at thykier.net>
Date: Sun Jan 14 10:22:37 2018 +0000
Update test to match previous commit
Signed-off-by: Niels Thykier <niels at thykier.net>
---
t/dh_installsystemd/dh_installsystemd.t | 5 ++++-
t/dh_installsystemd/dh_systemd.t | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/t/dh_installsystemd/dh_installsystemd.t b/t/dh_installsystemd/dh_installsystemd.t
index a33a835..50e737d 100755
--- a/t/dh_installsystemd/dh_installsystemd.t
+++ b/t/dh_installsystemd/dh_installsystemd.t
@@ -28,7 +28,10 @@ sub unit_is_enabled {
$num_masks = $num_masks // $num_enables;
my @postinst_snippets = find_script($package, 'postinst');
@output=`cat @postinst_snippets` if @postinst_snippets;
- $matches = grep { m{^if deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
+ # Match exactly one tab; the "dont-enable" script has an "enable"
+ # line for re-enabling the service if the admin had it enabled.
+ # But we do not want to include that in our count.
+ $matches = grep { m{^\tif deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
ok($matches == $num_enables) or diag("$unit appears to have been enabled $matches times (expected $num_enables)");
my @postrm_snippets = find_script($package, 'postrm');
@output=`cat @postrm_snippets` if @postrm_snippets;
diff --git a/t/dh_installsystemd/dh_systemd.t b/t/dh_installsystemd/dh_systemd.t
index dee7096..18f2f48 100755
--- a/t/dh_installsystemd/dh_systemd.t
+++ b/t/dh_installsystemd/dh_systemd.t
@@ -27,7 +27,10 @@ sub unit_is_enabled {
my $matches;
$num_masks = $num_masks // $num_enables;
@output=`cat debian/$package.postinst.debhelper`;
- $matches = grep { m{^if deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
+ # Match exactly one tab; the "dont-enable" script has an "enable"
+ # line for re-enabling the service if the admin had it enabled.
+ # But we do not want to include that in our count.
+ $matches = grep { m{^\tif deb-systemd-helper .* was-enabled .*'\Q$unit\E\.service'} } @output;
ok($matches == $num_enables) or diag("$unit appears to have been enabled $matches times (expected $num_enables)");
@output=`cat debian/$package.postrm.debhelper`;
$matches = grep { m{deb-systemd-helper mask.*'\Q$unit\E\.service'} } @output;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list