about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-04-02 01:13:51 +0000
committerEric Wong <e@80x24.org>2022-04-02 04:39:24 +0000
commit42e1fb419b74e0b5c9315dacdd08a0e0c91962e5 (patch)
treea1f4ca1c77a4d8d7c2d639d569139db288a14e05 /t
parent388ccd960deadfda46deba813c7f6fea01bfeef1 (diff)
downloadpublic-inbox-42e1fb419b74e0b5c9315dacdd08a0e0c91962e5.tar.gz
Apparently leaving {sqlite_unicode} unset isn't enough, and
there's subtle differences where BLOBs are stored differently
than TEXT when dealing with binary data.  We also want to avoid
odd cases where SQLite will attempt to treat a number-like value
as an integer.

This should avoid problems in case non-UTF-8 URLs and pathnames are
used.  They'll automatically be upgraded if not, but downgrades
to older lei would cause duplicates to appear.
Diffstat (limited to 't')
-rw-r--r--t/lei_mail_sync.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/lei_mail_sync.t b/t/lei_mail_sync.t
index 4439b818..74a6c8aa 100644
--- a/t/lei_mail_sync.t
+++ b/t/lei_mail_sync.t
@@ -1,5 +1,5 @@
 #!perl -w
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) 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;
@@ -19,6 +19,8 @@ my $deadbeef = "\xde\xad\xbe\xef";
 is($lms->set_src($deadbeef, $imap, 1), 1, 'set IMAP once');
 ok($lms->set_src($deadbeef, $imap, 1) == 0, 'set IMAP idempotently');
 is_deeply([$ro->folders], [$imap], 'IMAP folder added');
+note explain([$ro->folders($imap)]);
+note explain([$imap, [$ro->folders]]);
 is_deeply([$ro->folders($imap)], [$imap], 'IMAP folder with full GLOB');
 is_deeply([$ro->folders('imaps://bob@[::1]/INBOX')], [$imap],
                 'IMAP folder with partial GLOB');
@@ -37,6 +39,7 @@ is_deeply($ro->locations_for($deadbeef),
 
 if ('mess things up pretend old bug') {
         $lms->lms_write_prepare;
+        diag "messing things up";
         $lms->{dbh}->do('UPDATE folders SET loc = ? WHERE loc = ?', undef,
                         "$maildir/", $maildir);
         ok(delete $lms->{fmap}, 'clear folder map');