about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-09-15 19:51:37 +0000
committerEric Wong <e@80x24.org>2020-09-16 04:06:10 +0000
commit82d793d96cc37d5b3cf562c7081bfacb05d1e4cd (patch)
treea66af407cfa46641a77f60631cef50a8c487bbb4 /t
parent9cdeab04ebd95c7f778ba5f258399377b180f2cc (diff)
downloadpublic-inbox-82d793d96cc37d5b3cf562c7081bfacb05d1e4cd.tar.gz
treewide: relax allow >=40 chars for git OID
This will help with eventual git SHA-256 transitions.
Diffstat (limited to 't')
-rw-r--r--t/edit.t4
-rw-r--r--t/plack.t2
-rw-r--r--t/replace.t2
-rw-r--r--t/v2writable.t4
4 files changed, 6 insertions, 6 deletions
diff --git a/t/edit.t b/t/edit.t
index 4b004c1c..dbdda394 100644
--- a/t/edit.t
+++ b/t/edit.t
@@ -41,7 +41,7 @@ $t = '-F FILE'; {
         ok(run_script($cmd, undef, $opt), "$t edit OK");
         $cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
         like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
-        like($out, qr/[a-f0-9]{40}/, "$t shows commit on success");
+        like($out, qr/[a-f0-9]{40,}/, "$t shows commit on success");
 }
 
 $t = '-m MESSAGE_ID'; {
@@ -51,7 +51,7 @@ $t = '-m MESSAGE_ID'; {
         ok(run_script($cmd, undef, $opt), "$t edit OK");
         $cur = PublicInbox::Eml->new($ibx->msg_by_mid($mid));
         like($cur->header('Subject'), qr/boolean prefix/, "$t message edited");
-        like($out, qr/[a-f0-9]{40}/, "$t shows commit on success");
+        like($out, qr/[a-f0-9]{40,}/, "$t shows commit on success");
 }
 
 $t = 'no-op -m MESSAGE_ID'; {
diff --git a/t/plack.t b/t/plack.t
index 4b830a21..1fedf426 100644
--- a/t/plack.t
+++ b/t/plack.t
@@ -45,7 +45,7 @@ EOF
         $im->add($mime);
         $im->done;
         my $rev = $git->qx(qw(rev-list HEAD));
-        like($rev, qr/\A[a-f0-9]{40}/, "good revision committed");
+        like($rev, qr/\A[a-f0-9]{40,}/, "good revision committed");
         @ls = $git->qx(qw(ls-tree -r --name-only HEAD));
         chomp @ls;
 
diff --git a/t/replace.t b/t/replace.t
index 95241adf..fd8ce2c6 100644
--- a/t/replace.t
+++ b/t/replace.t
@@ -74,7 +74,7 @@ EOF
         for my $tip (@$cmts) {
                 next if !defined $tip;
                 $changed_epochs++;
-                like($tip, qr/\A[a-f0-9]{40}\z/,
+                like($tip, qr/\A[a-f0-9]{40,}\z/,
                         'replace returned current commit');
         }
         is($changed_epochs, 1, 'only one epoch changed');
diff --git a/t/v2writable.t b/t/v2writable.t
index 1de8c032..2f71fafa 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -255,8 +255,8 @@ EOF
 {
         ok($im->add($mime), 'add message to be purged');
         local $SIG{__WARN__} = sub {};
-        ok(my $cmts = $im->purge($mime), 'purged message');
-        like($cmts->[0], qr/\A[a-f0-9]{40}\z/, 'purge returned current commit');
+        ok(my $cmt = $im->purge($mime), 'purged message');
+        like($cmt->[0], qr/\A[a-f0-9]{40,}\z/, 'purge returned current commit');
         $im->done;
 
         # again