X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fv2writable.t;h=4a7cfb909ee6f3030d722a532a48e7174fad44d9;hb=c34a83286234ea1e876ebdf92a33744272bb6f4e;hp=c48f060e87978e979fcc72ff64540e42412e104a;hpb=9aaf9cf73f7b126ad3d2726adf7c764630626d67;p=public-inbox.git diff --git a/t/v2writable.t b/t/v2writable.t index c48f060e..4a7cfb90 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -43,13 +43,9 @@ if ('ensure git configs are correct') { qw(core.sharedRepository 0644)); is(system(@cmd), 0, "set sharedRepository in all.git"); $git0 = PublicInbox::Git->new("$mainrepo/git/0.git"); - my $fh = $git0->popen(qw(config core.sharedRepository)); - my $v = eval { local $/; <$fh> }; - chomp $v; + chomp(my $v = $git0->qx(qw(config core.sharedRepository))); is($v, '0644', 'child repo inherited core.sharedRepository'); - $fh = $git0->popen(qw(config --bool repack.writeBitmaps)); - $v = eval { local $/; <$fh> }; - chomp $v; + chomp($v = $git0->qx(qw(config --bool repack.writeBitmaps))); is($v, 'true', 'child repo inherited repack.writeBitmaps'); } @@ -214,9 +210,10 @@ EOF my @found = (); $srch->each_smsg_by_mid($smsg->mid, sub { push @found, @_; 1 }); is(scalar(@found), 0, 'no longer found in Xapian skeleton'); + my @log1 = qw(log -1 --pretty=raw --raw -r --no-abbrev --no-renames); - my $after = $git0->qx(qw(log -1 --pretty=raw --raw -r --no-abbrev)); - if ($after =~ m!( [a-f0-9]+ )A\t_/D$!) { + my $after = $git0->qx(@log1); + if ($after =~ m!( [a-f0-9]+ )A\td$!m) { my $oid = $1; ok(index($before, $oid) > 0, 'no new blob introduced'); } else { @@ -225,10 +222,17 @@ EOF is($im->remove($mime, 'test removal'), undef, 'remove is idempotent'); $im->done; - is($git0->qx(qw(log -1 --pretty=raw --raw -r --no-abbrev)), + is($git0->qx(@log1), $after, 'no git history made with idempotent remove'); eval { $im->done }; ok(!$@, '->done is idempotent'); } +{ + ok($im->add($mime), 'add message to be purged'); + local $SIG{__WARN__} = sub {}; + ok($im->purge($mime), 'purged message'); + $im->done; +} + done_testing();