X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fover.t;h=daa7176f493d2b0cbda7c4aa7e45a696cbff99c5;hb=253a86b7bf4a3d81118e91f4ebb77844cfbd2b32;hp=27168a33d49ed7156254b8b9faedf321c5f1ed81;hpb=ad6f26f3b9f0e428020d05667987556f8fcbec2f;p=public-inbox.git diff --git a/t/over.t b/t/over.t index 27168a33..daa7176f 100644 --- a/t/over.t +++ b/t/over.t @@ -4,12 +4,8 @@ use strict; use warnings; use Test::More; use Compress::Zlib qw(compress); -require './t/common.perl'; -foreach my $mod (qw(DBD::SQLite)) { - eval "require $mod"; - plan skip_all => "$mod missing for over.t" if $@; -} - +use PublicInbox::TestCommon; +require_mods('DBD::SQLite'); use_ok 'PublicInbox::OverIdx'; my ($tmpdir, $for_destroy) = tmpdir(); my $over = PublicInbox::OverIdx->new("$tmpdir/over.sqlite3"); @@ -22,10 +18,15 @@ is($y, $x+1, 'tid increases'); $x = $over->sid('hello-world'); is(int($x), $x, 'integer sid'); $y = $over->sid('hello-WORLD'); -is($y, $x+1, 'sid ncreases'); +is($y, $x+1, 'sid increases'); is($over->sid('hello-world'), $x, 'idempotent'); +ok(!$over->{dbh}->{ReadOnly}, 'OverIdx is not ReadOnly'); $over->disconnect; +$over = PublicInbox::Over->new("$tmpdir/over.sqlite3"); +$over->connect; +ok($over->{dbh}->{ReadOnly}, 'Over is ReadOnly'); + $over = PublicInbox::OverIdx->new("$tmpdir/over.sqlite3"); $over->connect; is($over->sid('hello-world'), $x, 'idempotent across reopen');