From 253a86b7bf4a3d81118e91f4ebb77844cfbd2b32 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 4 Feb 2020 04:44:25 +0000 Subject: over: simplify read-only vs read-write checking No need to call ref() and do a string comparison. Add some extra tests using the {ReadOnly} attribute in DBI.pm. --- t/over.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/over.t b/t/over.t index 4e630bcd..daa7176f 100644 --- a/t/over.t +++ b/t/over.t @@ -18,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'); -- cgit v1.2.3-24-ge0c7