]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/lei-mirror.t
t/cmd_ipc: allow extra errors and add diagnostics
[public-inbox.git] / t / lei-mirror.t
index 3eb7f36af5f66edb9a98a23ff9bf8cb68b4f88dc..de5246b60bce27c707c2a6e833bfe2655f79771f 100644 (file)
@@ -65,6 +65,14 @@ test_lei({ tmpdir => $tmpdir }, sub {
        lei_ok('ls-external');
        unlike($lei_out, qr!\Q$d\E!s, 'not added to ls-external');
 
+       $d = "$home/bad-epoch";
+       ok(!lei(qw(add-external -q --epoch=0.. --mirror), "$http/t1/", $d),
+               'v1 fails on --epoch');
+       ok(!-d $d, 'destination not created on unacceptable --epoch');
+       ok(!lei(qw(add-external -q --epoch=1 --mirror), "$http/t2/", $d),
+               'v2 fails on bad epoch range');
+       ok(!-d $d, 'destination not created on bad epoch');
+
        my %phail = (
                HTTPS => 'https://public-inbox.org/' . 'phail',
                ONION =>
@@ -116,12 +124,12 @@ SKIP: {
        ok(!run_script([qw(-fetch --exit-code -C), "$d/t2"], undef, $opt),
                '-fetch succeeds w/ manifest.js.gz');
        is($? >> 8, 127, '--exit-code gave 127');
-       unlike($err, qr/git fetch/, 'no fetch done w/ manifest');
+       unlike($err, qr/git --git-dir=\S+ fetch/, 'no fetch done w/ manifest');
        unlink("$d/t2/manifest.js.gz") or xbail "unlink $!";
        ok(!run_script([qw(-fetch --exit-code -C), "$d/t2"], undef, $opt),
                '-fetch succeeds w/o manifest.js.gz');
        is($? >> 8, 127, '--exit-code gave 127');
-       like($err, qr/git fetch/, 'fetch forced w/o manifest');
+       like($err, qr/git --git-dir=\S+ fetch/, 'fetch forced w/o manifest');
 
        ok(run_script([qw(-clone -q -C), $d, "$http/t1"], undef, $opt),
                'cloning v1 works');
@@ -131,14 +139,14 @@ SKIP: {
        ok(!run_script([qw(-fetch --exit-code -C), "$d/t1"], undef, $opt),
                'fetching v1 works');
        is($? >> 8, 127, '--exit-code gave 127');
-       unlike($err, qr/git fetch/, 'no fetch done w/ manifest');
+       unlike($err, qr/git --git-dir=\S+ fetch/, 'no fetch done w/ manifest');
        unlink("$d/t1/manifest.js.gz") or xbail "unlink $!";
        my $before = [ glob("$d/t1/*") ];
        ok(!run_script([qw(-fetch --exit-code -C), "$d/t1"], undef, $opt),
                'fetching v1 works w/o manifest.js.gz');
        is($? >> 8, 127, '--exit-code gave 127');
        unlink("$d/t1/FETCH_HEAD"); # git internal
-       like($err, qr/git fetch/, 'no fetch done w/ manifest');
+       like($err, qr/git --git-dir=\S+ fetch/, 'no fetch done w/ manifest');
        ok(unlink("$d/t1/manifest.js.gz"), 'manifest created');
        my $after = [ glob("$d/t1/*") ];
        is_deeply($before, $after, 'no new files created');