aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/runner/env.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-10-13 20:05:27 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-10-13 20:05:27 +0300
commit4564a26c0b88d684c12c396d7ef5b0e66f686964 (patch)
tree130e744bd182110184171fb38677f0fca60ec73f /tests/test/script/runner/env.testscript
parentb7997a0becbecd775694aa7f106afb3c0e777b8d (diff)
Add --cwd|-t option to env pseudo-builtin
Diffstat (limited to 'tests/test/script/runner/env.testscript')
-rw-r--r--tests/test/script/runner/env.testscript34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/test/script/runner/env.testscript b/tests/test/script/runner/env.testscript
index ef90c3b..512139a 100644
--- a/tests/test/script/runner/env.testscript
+++ b/tests/test/script/runner/env.testscript
@@ -3,6 +3,40 @@
.include ../common.testscript
+: cwd
+:
+{
+ : not-exist
+ :
+ $c <'env -c a -- $* -w' && $b 2>>/~%EOE% != 0
+ %testscript:1:1: error: specified working directory .+/a/ does not exist%
+ info: test id: 1
+ EOE
+
+ : process
+ :
+ $c <<EOI && $b
+ mkdir a;
+ env -c a -- $* -w >/~%.+/a%
+ EOI
+
+ : builtin
+ :
+ $c <<EOI && $b
+ mkdir a;
+ env -c a -- touch b;
+ test -f a/b
+ EOI
+
+ : absolute
+ :
+ $c <<EOI && $b
+ mkdir a;
+ env -c $~/a -- touch b;
+ test -f a/b
+ EOI
+}
+
: variables
:
{