aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin
diff options
context:
space:
mode:
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
+}