diff options
author | Eric Wong <e@80x24.org> | 2016-12-12 12:02:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-12-12 12:04:23 +0000 |
commit | 3043725a10eae59a71c25ba5e4d424a49326afd7 (patch) | |
tree | 6d18b1c384c087ed29a6f74a57a8aa5611889c4b /t | |
parent | 53e8cfbe4e06e5ae6ad61fb7e9bd45804c253a72 (diff) | |
download | public-inbox-3043725a10eae59a71c25ba5e4d424a49326afd7.tar.gz |
This matches git-config(1) behavior, and implied user intent when it comes to programatically editing files.
Diffstat (limited to 't')
-rw-r--r-- | t/init.t | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -13,10 +13,16 @@ use constant pi_init => 'blib/script/public-inbox-init'; my $cfgfile = "$ENV{PI_DIR}/config"; my @cmd = (pi_init, 'blist', "$tmpdir/blist", qw(http://example.com/blist blist@example.com)); - is(system(@cmd), 0, 'public-inbox-init failed'); + is(system(@cmd), 0, 'public-inbox-init OK'); ok(-e $cfgfile, "config exists, now"); - is(system(@cmd), 0, 'public-inbox-init failed (idempotent)'); + is(system(@cmd), 0, 'public-inbox-init OK (idempotent)'); + + chmod 0666, $cfgfile or die "chmod failed: $!"; + @cmd = (pi_init, 'clist', "$tmpdir/clist", + qw(http://example.com/clist clist@example.com)); + is(system(@cmd), 0, 'public-inbox-init clist OK'); + is((stat($cfgfile))[2] & 07777, 0666, "permissions preserved"); } done_testing(); |