]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/init.t
watchmaildir: ensure I:/W:/E: prefixes in warnings
[public-inbox.git] / t / init.t
index 6211bb58fba8b12a43cc786255e629c28c51d95d..a5a9debc6453dd799ebc1b312101df423e14ec45 100644 (file)
--- a/t/init.t
+++ b/t/init.t
@@ -95,6 +95,20 @@ SKIP: {
                my $ibx = PublicInbox::Inbox->new({ inboxdir => $dir });
                is(PublicInbox::Admin::detect_indexlevel($ibx), $lvl,
                        'detected expected level w/o config');
+               ok(!$ibx->{-skip_docdata}, 'docdata written by default');
+       }
+       for my $v (1, 2) {
+               my $name = "v$v-skip-docdata";
+               my $dir = "$tmpdir/$name";
+               $cmd = [ '-init', $name, "-V$v", '--skip-docdata',
+                       $dir, "http://example.com/$name",
+                       "$name\@example.com" ];
+               ok(run_script($cmd), "-init -V$v --skip-docdata");
+               my $ibx = PublicInbox::Inbox->new({ inboxdir => $dir });
+               is(PublicInbox::Admin::detect_indexlevel($ibx), 'full',
+                       "detected default indexlevel -V$v");
+               ok($ibx->{-skip_docdata}, "docdata skip set -V$v");
+               ok($ibx->search->has_threadid, 'has_threadid flag set on new inbox');
        }
 
        # loop for idempotency
@@ -116,7 +130,7 @@ SKIP: {
                        'publicinboxmda.spamcheck', 'none') == 0 or
                        BAIL_OUT "git config $?";
        my $addr = 'skip3@example.com';
-       $cmd = [ qw(-init -V2 -Lbasic -N12 skip3), "$tmpdir/skip3",
+       $cmd = [ qw(-init -V2 -Lbasic --skip-artnum=12 skip3), "$tmpdir/skip3",
                   qw(http://example.com/skip3), $addr ];
        ok(run_script($cmd), '--skip-artnum -V2');
        my $env = { ORIGINAL_RECIPIENT => $addr };
@@ -131,7 +145,7 @@ SKIP: {
 
        $addr = 'skip4@example.com';
        $env = { ORIGINAL_RECIPIENT => $addr };
-       $cmd = [ qw(-init -V1 -N12 -Lmedium skip4), "$tmpdir/skip4",
+       $cmd = [ qw(-init -V1 --skip-artnum 12 -Lmedium skip4), "$tmpdir/skip4",
                   qw(http://example.com/skip4), $addr ];
        ok(run_script($cmd), '--skip-artnum -V1');
        $err = '';