about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-08-11 11:26:17 +0000
committerEric Wong <e@80x24.org>2021-08-11 21:50:08 +0000
commitd15e80db44399867d8ca53528e38f70f54562b88 (patch)
tree40e1f4d12f3ca6a88b9e149ad4f85c6e9884ee8a /t
parent4c6f9a39621fdae852e0655b7db3d61f03c716c5 (diff)
downloadpublic-inbox-d15e80db44399867d8ca53528e38f70f54562b88.tar.gz
Storing relative paths with '..' in them can be expensive to
resolve when running 'lei up', so prefer storing canonicalized
absolute paths.  We only do this for paths with '..' in them,
though, since this can lose symlink info.
Diffstat (limited to 't')
-rw-r--r--t/lei-q-save.t9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/lei-q-save.t b/t/lei-q-save.t
index b1ca4e92..eada2dd4 100644
--- a/t/lei-q-save.t
+++ b/t/lei-q-save.t
@@ -202,5 +202,14 @@ test_lei(sub {
 
         lei_ok([qw(edit-search), $v2s], { VISUAL => 'cat', EDITOR => 'cat' });
         like($lei_out, qr/^\[lei/sm, 'edit-search can cat');
+
+        lei_ok('-C', "$home/v2s",
+                qw(q -q --save -o ../s m:testmessage@example.com));
+        lei_ok qw(ls-search);
+        unlike $lei_out, qr{/\.\./s$}sm, 'relative path not in ls-search';
+        like $lei_out, qr{^\Q$home\E/s$}sm,
+                'absolute path appears in ls-search';
+        lei_ok qw(up ../s -C), "$home/v2s", \'relative lei up';
+        lei_ok qw(up), "$home/s", \'absolute lei up';
 });
 done_testing;