Skip to content

Commit 1b6bdcb

Browse files
committed
t/maniadd.t: Add a test for bug #13
1 parent 0900948 commit 1b6bdcb

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

t/maniadd.t

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use lib 't/lib';
55
use ManifestTest qw( catch_warning canon_warning spew runtemp );
66
use ExtUtils::Manifest qw( maniadd );
77
use Config;
8-
use Test::More tests => 5;
8+
use Test::More tests => 7;
99

1010
my $LAST_ERROR;
1111

@@ -51,3 +51,25 @@ SKIP: {
5151
}
5252

5353
};
54+
55+
runtemp "maniadd.unneeded_readonly_notrailingeol" => sub {
56+
note "Ensuring maniadd does not arbitrarily make a file writeable if it lacks an EOL";
57+
local $TODO = "Broken, GH #13";
58+
spew( "MANIFEST", "foo #bar" );
59+
SKIP: {
60+
chmod( 0400, "MANIFEST" );
61+
62+
if ( -w "MANIFEST" or $Config{osname} eq "cygwin" ) {
63+
skip "Cant make manifest readonly", 5;
64+
}
65+
ok( !fatal { maniadd( { "foo" => "bar" } ) }, "maniadd() wont die adding an existing key" )
66+
or diag $LAST_ERROR;
67+
68+
ok( !-w "MANIFEST", "MANIFEST is still readonly" );
69+
70+
chmod( 0600, "MANIFEST" );
71+
72+
}
73+
74+
};
75+

0 commit comments

Comments
 (0)