From dbed808c7d534069f76e63a1a68a85f30d2be81c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 10 Sep 2019 23:23:43 +0300 Subject: Move testscript builtins to libbutl --- tests/test/script/builtin/touch.testscript | 97 ++++++------------------------ 1 file changed, 19 insertions(+), 78 deletions(-) (limited to 'tests/test/script/builtin/touch.testscript') 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 <=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 <"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 <"touch: invalid path ''" != 0 -EOI - -: dir-update -: -: Test touching an existing directory. -: -$c <~'%touch: cannot create/update .+: .+%' != 0 -EOI - -: after +: cleanup : { - : success + : enabled : - $c <"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 <~"%touch: cannot obtain file '.+a' modification time: .+%" != 0 - EOI + { + +touch a + { + touch ../a + } + } + EOI } -- cgit v1.1