]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/index-git-times.t
update copyrights for 2021
[public-inbox.git] / t / index-git-times.t
index 8f80c8669363d1892984bfa4487e3c1f779a8135..3cfb99f476cfc56aaa9b91a38ac48199417fcdcb 100644 (file)
@@ -1,8 +1,10 @@
-# Copyright (C) 2020 all contributors <meta@public-inbox.org>
+#!perl -w
+# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+use strict;
+use v5.10.1;
 use Test::More;
 use PublicInbox::TestCommon;
-use PublicInbox::Import;
 use PublicInbox::Config;
 use PublicInbox::Admin;
 use File::Path qw(remove_tree);
@@ -45,7 +47,7 @@ EOF
        print $w $data or die;
        close $w or die;
        my $cmd = ['git', "--git-dir=$v1dir", 'fast-import', '--quiet'];
-       PublicInbox::Import::run_die($cmd, undef, { 0 => $r });
+       xsys_e($cmd, undef, { 0 => $r });
 }
 
 run_script(['-index', '--skip-docdata', $v1dir]) or die 'v1 index failed';
@@ -60,10 +62,12 @@ my $smsg;
        $smsg = $ibx->over->get_art(1);
        is($smsg->{ds}, 749520000, 'datestamp from git author time');
        is($smsg->{ts}, 1285977600, 'timestamp from git committer time');
-       my $res = $ibx->search->query("m:$smsg->{mid}");
-       is(scalar @$res, 1, 'got one result for m:');
+       my $mset = $ibx->search->mset("m:$smsg->{mid}");
+       is($mset->size, 1, 'got one result for m:');
+       my $res = $ibx->search->mset_to_smsg($ibx, $mset);
        is($res->[0]->{ds}, $smsg->{ds}, 'Xapian stored datestamp');
-       $res = $ibx->search->query('d:19931002..19931002');
+       $mset = $ibx->search->mset('d:19931002..19931002');
+       $res = $ibx->search->mset_to_smsg($ibx, $mset);
        is(scalar @$res, 1, 'got one result for d:');
        is($res->[0]->{ds}, $smsg->{ds}, 'Xapian search on datestamp');
 }
@@ -84,9 +88,11 @@ SKIP: {
                        'v2 datestamp from git author time');
                is($v2smsg->{ts}, $smsg->{ts},
                        'v2 timestamp from git committer time');
-               my $res = $ibx->search->query("m:$smsg->{mid}");
+               my $mset = $ibx->search->mset("m:$smsg->{mid}");
+               my $res = $ibx->search->mset_to_smsg($ibx, $mset);
                is($res->[0]->{ds}, $smsg->{ds}, 'Xapian stored datestamp');
-               $res = $ibx->search->query('d:19931002..19931002');
+               $mset = $ibx->search->mset('d:19931002..19931002');
+               $res = $ibx->search->mset_to_smsg($ibx, $mset);
                is(scalar @$res, 1, 'got one result for d:');
                is($res->[0]->{ds}, $smsg->{ds}, 'Xapian search on datestamp');
        };