about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-04-13 10:54:45 +0000
committerEric Wong <e@80x24.org>2021-04-13 15:05:02 -0400
commit8ab43c1c27c725a8ef9307f5dba3e565169d48ca (patch)
tree12c761c064692e1c08b106b246fa72f713a73ee8 /t
parent26e0fe73de93f451ae5575f7625fec8ae020673c (diff)
downloadpublic-inbox-8ab43c1c27c725a8ef9307f5dba3e565169d48ca.tar.gz
This will have a over.sqlite3 for content-based deduplication.
It may exhibit ibxish methods, so serving a read-only (or even
R/W) IMAP or instance or displaying HTML isn't outside the realm
of possibility.
Diffstat (limited to 't')
-rw-r--r--t/lei-q-save.t12
-rw-r--r--t/lei.t2
-rw-r--r--t/lei_saved_search.t10
3 files changed, 23 insertions, 1 deletions
diff --git a/t/lei-q-save.t b/t/lei-q-save.t
new file mode 100644
index 00000000..56f7cb37
--- /dev/null
+++ b/t/lei-q-save.t
@@ -0,0 +1,12 @@
+#!perl -w
+# Copyright (C) 2021 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; use PublicInbox::TestCommon;
+test_lei(sub {
+        my $home = $ENV{HOME};
+        lei_ok qw(import t/plack-qp.eml);
+        lei_ok qw(q --save z:0..), '-o', "$home/md/";
+        my @s = glob("$home/.local/share/lei/saved-searches/md-*");
+        is(scalar(@s), 1, 'got one saved search');
+});
+done_testing;
diff --git a/t/lei.t b/t/lei.t
index 2be9b4e8..6ade2f18 100644
--- a/t/lei.t
+++ b/t/lei.t
@@ -114,7 +114,7 @@ my $test_completion = sub {
         %out = map { $_ => 1 } split(/\s+/s, $lei_out);
         for my $sw (qw(-f --format -o --output --mfolder --augment -a
                         --mua --no-local --local --verbose -v
-                        --save-as --no-remote --remote --torsocks
+                        --save --no-remote --remote --torsocks
                         --reverse -r )) {
                 ok($out{$sw}, "$sw offered as `lei q' completion");
         }
diff --git a/t/lei_saved_search.t b/t/lei_saved_search.t
new file mode 100644
index 00000000..6d26cd2b
--- /dev/null
+++ b/t/lei_saved_search.t
@@ -0,0 +1,10 @@
+#!perl -w
+# Copyright (C) 2021 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;
+use PublicInbox::TestCommon;
+require_mods(qw(DBD::SQLite));
+use_ok 'PublicInbox::LeiSavedSearch';
+
+done_testing;