aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-07-17 14:46:18 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-17 14:47:25 +0300
commit0898e65ca37686a0a06a2980acf8cc40c0e2494e (patch)
treee575f1c87bd9d3bb8dde1198389b8bd9f7b697fc /tests/test/script/builtin
parentfe6f3ec0868185511f5acefb2729eb879798f052 (diff)
Add --after <ref-file> option for testscript touch builtin
Diffstat (limited to 'tests/test/script/builtin')
-rw-r--r--tests/test/script/builtin/touch.test35
1 files changed, 29 insertions, 6 deletions
diff --git a/tests/test/script/builtin/touch.test b/tests/test/script/builtin/touch.test
index 7188a21..04391bd 100644
--- a/tests/test/script/builtin/touch.test
+++ b/tests/test/script/builtin/touch.test
@@ -22,14 +22,14 @@ EOI
: Test that existing file touch doesn't fail.
:
$c <<EOI && $b
-cat <"" >=a;
+cat <'' >=a;
touch a
EOI
: no-cleanup
:
-: Test that touches an existing file doesn't register cleanup. If it does then
-: the file would be removed while leaving the embedded scope, and so the
+: Test that touching an existing file does not register cleanup. If it does
+: then the file would be removed while leaving the embedded scope, and so the
: cleanup registered by the first touch would fail.
:
$c <<EOI && $b
@@ -45,14 +45,14 @@ EOI
:
: Test passing no arguments.
:
-$c <'touch 2>"touch: missing file" == 1' && $b
+$c <'touch --no-cleanup 2>"touch: missing file" != 0' && $b
: empty-path
:
: Test touching an empty path.
:
$c <<EOI && $b
-touch '' 2>"touch: invalid path ''" == 1
+touch '' 2>"touch: invalid path ''" != 0
EOI
: dir-update
@@ -61,5 +61,28 @@ EOI
:
$c <<EOI && $b
mkdir a;
-touch a 2>~"%touch: cannot create/update .+: .+%" == 1
+touch a 2>~'%touch: cannot create/update .+: .+%' != 0
EOI
+
+: after
+:
+{
+ : success
+ :
+ $c <<EOI && $b
+ touch a;
+ touch --after a b
+ EOI
+
+ : no-value
+ :
+ $c <<EOI && $b
+ touch --after 2>'touch: missing --after option value' != 0
+ EOI
+
+ : not-exists
+ :
+ $c <<EOI && $b
+ touch --after a b 2>~"%touch: cannot obtain file '.+a' modification time: .+%" != 0
+ EOI
+}