about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-20 14:04:47 +0900
committerEric Wong <e@80x24.org>2021-01-21 03:29:19 +0000
commit1a8441c1e5e468441e67bc7eec6771770e62af78 (patch)
treea30120a563345c79307aadd5d95d8bb9624a5e02 /t
parent7fc6a3487d28b755424c262bf50de9ec2015aa50 (diff)
downloadpublic-inbox-1a8441c1e5e468441e67bc7eec6771770e62af78.tar.gz
Inspired by "dmesg -c", this should help users report bugs
and avoids eating up $XDG_RUNTIME_DIR.

Once lei is ready for release, hopefully the need for this
should be few an far between, but shit happens.
Diffstat (limited to 't')
-rw-r--r--t/lei.t6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/lei.t b/t/lei.t
index d49dc01a..ef820fe3 100644
--- a/t/lei.t
+++ b/t/lei.t
@@ -258,6 +258,7 @@ SKIP: { # real socket
         } // skip 'Socket::MsgHdr or Inline::C missing or unconfigured', 115;
         local $ENV{XDG_RUNTIME_DIR} = "$home/xdg_run";
         my $sock = "$ENV{XDG_RUNTIME_DIR}/lei/5.seq.sock";
+        my $err_log = "$ENV{XDG_RUNTIME_DIR}/lei/errors.log";
 
         ok($lei->('daemon-pid'), 'daemon-pid');
         is($err, '', 'no error from daemon-pid');
@@ -267,10 +268,15 @@ SKIP: { # real socket
         ok(-S $sock, 'sock created');
 
         $test_lei_common->();
+        is(-s $err_log, 0, 'nothing in errors.log');
+        open my $efh, '>>', $err_log or BAIL_OUT $!;
+        print $efh "phail\n" or BAIL_OUT $!;
+        close $efh or BAIL_OUT $!;
 
         ok($lei->('daemon-pid'), 'daemon-pid');
         chomp(my $pid_again = $out);
         is($pid, $pid_again, 'daemon-pid idempotent');
+        like($err, qr/phail/, 'got mock "phail" error previous run');
 
         ok($lei->(qw(daemon-kill)), 'daemon-kill');
         is($out, '', 'no output from daemon-kill');