aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/builtin/touch.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-09-10 23:23:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-09-27 18:04:30 +0300
commitdbed808c7d534069f76e63a1a68a85f30d2be81c (patch)
tree3161d9c9617f2fccf37bd278f0c9bf45fad2e20e /tests/test/script/builtin/touch.testscript
parent6e84c0f9c5e4d7d98d2a352eec6bc19de0d75d28 (diff)
Move testscript builtins to libbutl
Diffstat (limited to 'tests/test/script/builtin/touch.testscript')
-rw-r--r--tests/test/script/builtin/touch.testscript97
1 files changed, 19 insertions, 78 deletions
diff --git a/tests/test/script/builtin/touch.testscript b/tests/test/script/builtin/touch.testscript
index 731f023..e9549d2 100644
--- a/tests/test/script/builtin/touch.testscript
+++ b/tests/test/script/builtin/touch.testscript
@@ -4,91 +4,32 @@
.include ../common.testscript
-: file
-:
-$c <'touch a' && $b
-
-: file-create
-:
-: Test that file is created. If it didn't then 'rm' would fail.
-:
-$c <<EOI && $b
-touch a &!a;
-rm a
-EOI
-
-: file-update
-:
-: Test that existing file touch doesn't fail.
-:
-$c <<EOI && $b
-cat <'' >=a;
-touch a
-EOI
-
-: no-cleanup
-:
-: 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
-{
- +touch a
- {
- touch ../a
- }
-}
-EOI
-
-: unknown-option
-:
-$c <<EOI && $b
-touch -u 2>"touch: unknown option '-u'" == 1
-EOI
-
-: no-args
-:
-: Test passing no arguments.
-:
-$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 ''" != 0
-EOI
-
-: dir-update
-:
-: Test touching an existing directory.
-:
-$c <<EOI && $b
-mkdir a;
-touch a 2>~'%touch: cannot create/update .+: .+%' != 0
-EOI
-
-: after
+: cleanup
:
{
- : success
+ : enabled
:
- $c <<EOI && $b
- touch a;
- touch --after a b
- EOI
+ $c <'touch a' && $b
- : no-value
+ : disabled
:
$c <<EOI && $b
- touch --after 2>"touch: missing value for option '--after'" != 0
- EOI
+ touch --no-cleanup a;
+ rm a
+ EOI
- : not-exists
+ : existing
+ :
+ : 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
- touch --after a b 2>~"%touch: cannot obtain file '.+a' modification time: .+%" != 0
- EOI
+ {
+ +touch a
+ {
+ touch ../a
+ }
+ }
+ EOI
}