about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-05-10 22:37:12 +0000
committerEric Wong <e@yhbt.net>2020-05-12 06:15:59 +0000
commit098fecd1fe516a00fbfd49622b82be382ebcdab6 (patch)
tree0b38bb0910e6f9b8c3600ba6ef105aac43bafed6 /t
parentcd8cda10c9687533949a8a358fd7b858f704da6e (diff)
downloadpublic-inbox-098fecd1fe516a00fbfd49622b82be382ebcdab6.tar.gz
The old name may be confused with "Content-ID" as described in
RFC 2392, so use an alternate name to avoid confusing future
readers.
Diffstat (limited to 't')
-rw-r--r--t/content_hash.t (renamed from t/content_id.t)14
-rw-r--r--t/v1reindex.t2
-rw-r--r--t/v2reindex.t2
-rw-r--r--t/v2writable.t4
4 files changed, 11 insertions, 11 deletions
diff --git a/t/content_id.t b/t/content_hash.t
index 9df81aa8..646aab07 100644
--- a/t/content_id.t
+++ b/t/content_hash.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::ContentId qw(content_id);
+use PublicInbox::ContentHash qw(content_hash);
 use PublicInbox::Eml;
 
 my $mime = PublicInbox::Eml->new(<<'EOF');
@@ -16,17 +16,17 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
 hello world
 EOF
 
-my $orig = content_id($mime);
-my $reload = content_id(PublicInbox::Eml->new($mime->as_string));
-is($orig, $reload, 'content_id matches after serialization');
+my $orig = content_hash($mime);
+my $reload = content_hash(PublicInbox::Eml->new($mime->as_string));
+is($orig, $reload, 'content_hash matches after serialization');
 
 foreach my $h (qw(From To Cc)) {
         my $n = q("Quoted N'Ame" <foo@EXAMPLE.com>);
         $mime->header_set($h, "$n");
-        my $q = content_id($mime);
-        is($mime->header($h), $n, "content_id does not mutate $h:");
+        my $q = content_hash($mime);
+        is($mime->header($h), $n, "content_hash does not mutate $h:");
         $mime->header_set($h, 'Quoted N\'Ame <foo@example.com>');
-        my $nq = content_id($mime);
+        my $nq = content_hash($mime);
         is($nq, $q, "quotes ignored in $h:");
 }
 
diff --git a/t/v1reindex.t b/t/v1reindex.t
index 13605f8b..9f23ef01 100644
--- a/t/v1reindex.t
+++ b/t/v1reindex.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::ContentId qw(content_digest);
+use PublicInbox::ContentHash qw(content_digest);
 use File::Path qw(remove_tree);
 use PublicInbox::TestCommon;
 use PublicInbox::Eml;
diff --git a/t/v2reindex.t b/t/v2reindex.t
index f16a0b0d..b99106d0 100644
--- a/t/v2reindex.t
+++ b/t/v2reindex.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::Eml;
-use PublicInbox::ContentId qw(content_digest);
+use PublicInbox::ContentHash qw(content_digest);
 use File::Path qw(remove_tree);
 use PublicInbox::TestCommon;
 require_git(2.6);
diff --git a/t/v2writable.t b/t/v2writable.t
index e5a565ce..fa5c786e 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::Eml;
-use PublicInbox::ContentId qw(content_digest content_id);
+use PublicInbox::ContentHash qw(content_digest content_hash);
 use PublicInbox::TestCommon;
 use Cwd qw(abs_path);
 require_git(2.6);
@@ -215,7 +215,7 @@ EOF
         $im = PublicInbox::V2Writable->new($ibx, {nproc => 2});
         is($im->{shards}, 1, 'detected single shard from previous');
         my ($mark, $rm_mime, $smsg) = $im->remove($mime, 'test removal');
-        is(content_id($rm_mime), content_id($mime),
+        is(content_hash($rm_mime), content_hash($mime),
                         'removed object returned matches');
         ok(defined($mark), 'mark set');
         $im->done;