about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-05 09:04:36 +0000
committerEric Wong <e@80x24.org>2021-01-06 10:45:08 +0000
commit27f8e2b161f4a8bb1ef030bd45e3f5ae7a9f0bb0 (patch)
tree63eda0889200ca0efe2dd10c88144fb2827e9ec0 /t
parent8bad040482941cc424888f3cf48c17e48953342d (diff)
downloadpublic-inbox-27f8e2b161f4a8bb1ef030bd45e3f5ae7a9f0bb0.tar.gz
There may be subtle misbehaviours when mixing the existing
daemon env and the client-supplied env.  Just do the simplest
thing and use the client env as-is.

We'll also start the ->event_step callback since we'll need
to remember some things for long-lived commands.
Diffstat (limited to 't')
-rw-r--r--t/lei.t30
1 files changed, 1 insertions, 29 deletions
diff --git a/t/lei.t b/t/lei.t
index 5afb8351..6d47e307 100644
--- a/t/lei.t
+++ b/t/lei.t
@@ -192,7 +192,7 @@ if ($ENV{TEST_LEI_ONESHOT}) {
 }
 
 SKIP: { # real socket
-        require_mods(qw(Cwd), my $nr = 46);
+        require_mods(qw(Cwd), my $nr = 105);
         my $nfd = eval { require IO::FDPass; 1 } // do {
                 require PublicInbox::Spawn;
                 PublicInbox::Spawn->can('send_3fds') ? 3 : undef;
@@ -215,34 +215,6 @@ SKIP: { # real socket
         chomp(my $pid_again = $out);
         is($pid, $pid_again, 'daemon-pid idempotent');
 
-        ok($lei->(qw(daemon-env -0)), 'show env');
-        is($err, '', 'no errors in env dump');
-        my @env = split(/\0/, $out);
-        is(scalar grep(/\AHOME=\Q$home\E\z/, @env), 1, 'env has HOME');
-        is(scalar grep(/\AFOO=BAR\z/, @env), 1, 'env has FOO=BAR');
-        is(scalar grep(/\AXDG_RUNTIME_DIR=/, @env), 1, 'has XDG_RUNTIME_DIR');
-
-        ok($lei->(qw(daemon-env -u FOO)), 'unset');
-        is($out.$err, '', 'no output for unset');
-        ok($lei->(qw(daemon-env -0)), 'show again');
-        is($err, '', 'no errors in env dump');
-        @env = split(/\0/, $out);
-        is(scalar grep(/\AFOO=BAR\z/, @env), 0, 'env unset FOO');
-
-        ok($lei->(qw(daemon-env -u FOO -u HOME -u XDG_RUNTIME_DIR)),
-                        'unset multiple');
-        is($out.$err, '', 'no errors output for unset');
-
-        ok($lei->(qw(daemon-env -0)), 'show again');
-        is($err, '', 'no errors in env dump');
-        @env = split(/\0/, $out);
-        is(scalar grep(/\A(?:HOME|XDG_RUNTIME_DIR)=\z/, @env), 0, 'env unset@');
-
-        ok($lei->(qw(daemon-env -)), 'clear env');
-        is($out.$err, '', 'no output');
-        ok($lei->(qw(daemon-env)), 'env is empty');
-        is($out, '', 'env cleared');
-
         ok($lei->(qw(daemon-kill)), 'daemon-kill');
         is($out, '', 'no output from daemon-kill');
         is($err, '', 'no error from daemon-kill');