X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fover.t;h=a92d2f77b0397012121d24a155ff32aa9bb8acf7;hb=67fe4d8d90ac77419c8fc41457c849aa7d366a9d;hp=4c8f8098a3e3edefbf978eb6ea5be5608f0ece53;hpb=7f4a11a6499aade26b418b7ae13cd12859f75bdd;p=public-inbox.git diff --git a/t/over.t b/t/over.t index 4c8f8098..a92d2f77 100644 --- a/t/over.t +++ b/t/over.t @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2020 all contributors +# Copyright (C) 2018-2021 all contributors # License: AGPL-3.0+ use strict; use warnings; @@ -74,4 +74,28 @@ SKIP: { 'WAL journal_mode not clobbered if manually set'); } +# ext index additions +$over->eidx_prep; +{ + my @arg = qw(1349 2019 adeadba7cafe example.key); + ok($over->add_xref3(@arg), 'first add'); + ok($over->add_xref3(@arg), 'add idempotent'); + my $xref3 = $over->get_xref3(1349); + is_deeply($xref3, [ 'example.key:2019:adeadba7cafe' ], 'xref3 works'); + + @arg = qw(1349 2018 deadbeefcafe example.kee); + ok($over->add_xref3(@arg), 'add another xref3'); + $xref3 = $over->get_xref3(1349); + is_deeply($xref3, [ 'example.key:2019:adeadba7cafe', + 'example.kee:2018:deadbeefcafe' ], + 'xref3 works forw two'); + + @arg = qw(1349 adeadba7cafe example.key); + is($over->remove_xref3(@arg), 1, 'remove first'); + $xref3 = $over->get_xref3(1349); + is_deeply($xref3, [ 'example.kee:2018:deadbeefcafe' ], + 'confirm removal successful'); + $over->rollback_lazy; +} + done_testing();