diff options
author | Eric Wong <e@80x24.org> | 2020-12-21 07:51:21 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-12-21 21:51:58 +0000 |
commit | 427b4fbbc68e4e03b20d66062dd47a0213e18390 (patch) | |
tree | fe5bbd9aa2fe7b51852cd6b4733b53ce2a6118b9 /t/search.t | |
parent | 3e9888ed30b7fe092b03789d19a8020d4bc0fb39 (diff) | |
download | public-inbox-427b4fbbc68e4e03b20d66062dd47a0213e18390.tar.gz |
Values can be strings in Xapian, although we currently use integer values exclusively. Give the wrapper a more appropriate name in case we start using string columns. For future-proofing, we'll now return `undef' on missing columns and coerce the return value to an IV (integer value) to save memory, as sortable_unserialise returns a PV (pointer value) scalar despite it existing to support numeric values.
Diffstat (limited to 't/search.t')
-rw-r--r-- | t/search.t | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -332,13 +332,13 @@ $ibx->with_umask(sub { like($smsg->{to}, qr/\blist\@example\.com\b/, 'to appears'); my $doc = $m->get_document; my $col = PublicInbox::Search::BYTES(); - my $bytes = PublicInbox::SearchIdx::get_val($doc, $col); + my $bytes = PublicInbox::SearchIdx::int_val($doc, $col); like($bytes, qr/\A[0-9]+\z/, '$bytes stored as digit'); ok($bytes > 0, '$bytes is > 0'); is($bytes, $smsg->{bytes}, 'bytes Xapian value matches Over'); $col = PublicInbox::Search::UID(); - my $uid = PublicInbox::SearchIdx::get_val($doc, $col); + my $uid = PublicInbox::SearchIdx::int_val($doc, $col); is($uid, $smsg->{num}, 'UID column matches {num}'); is($uid, $m->get_docid, 'UID column matches docid'); } |