[Rt-commit] rt branch, 4.0/mail-log-parse-dev-tool, updated. rt-4.0.13-153-g4a9f5c2
Thomas Sibley
trs at bestpractical.com
Thu Jul 11 20:35:58 EDT 2013
The branch, 4.0/mail-log-parse-dev-tool has been updated
via 4a9f5c227db8c8765daa6c98bb888858bed564d1 (commit)
from a15f023fb6dd30779f3e68f1814c300f13179b87 (commit)
Summary of changes:
t/99-policy.t | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
- Log -----------------------------------------------------------------
commit 4a9f5c227db8c8765daa6c98bb888858bed564d1
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Jul 11 16:59:48 2013 -0700
Don't check for strict/warnings if a shebang is OK and the shebang isn't perl
This prevents bogus strict/warnings tests on bash scripts, for instance.
The only file this change affects at the moment is
devel/tools/rt-parse-mail-log.
diff --git a/t/99-policy.t b/t/99-policy.t
index a7b0675..0b9f261 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -32,17 +32,19 @@ sub check {
open my $fh, '<', $file or die $!;
my $content = <$fh>;
- like(
- $content,
- qr/^use strict(?:;|\s+)/m,
- "$file has 'use strict'"
- ) if $check{strict};
-
- like(
- $content,
- qr/^use warnings(?:;|\s+)/m,
- "$file has 'use warnings'"
- ) if $check{warnings};
+ unless ($check{shebang} != -1 and $content =~ /^#!(?!.*perl)/i) {
+ like(
+ $content,
+ qr/^use strict(?:;|\s+)/m,
+ "$file has 'use strict'"
+ ) if $check{strict};
+
+ like(
+ $content,
+ qr/^use warnings(?:;|\s+)/m,
+ "$file has 'use warnings'"
+ ) if $check{warnings};
+ }
if ($check{shebang} == 1) {
like( $content, qr/^#!/, "$file has shebang" );
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list