From 0898e65ca37686a0a06a2980acf8cc40c0e2494e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 17 Jul 2018 14:46:18 +0300 Subject: Add --after option for testscript touch builtin --- tests/test/script/builtin/touch.test | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'tests/test/script/builtin') 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 <=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 <"touch: missing file" == 1' && $b +$c <'touch --no-cleanup 2>"touch: missing file" != 0' && $b : empty-path : : Test touching an empty path. : $c <"touch: invalid path ''" == 1 +touch '' 2>"touch: invalid path ''" != 0 EOI : dir-update @@ -61,5 +61,28 @@ EOI : $c <~"%touch: cannot create/update .+: .+%" == 1 +touch a 2>~'%touch: cannot create/update .+: .+%' != 0 EOI + +: after +: +{ + : success + : + $c <'touch: missing --after option value' != 0 + EOI + + : not-exists + : + $c <~"%touch: cannot obtain file '.+a' modification time: .+%" != 0 + EOI +} -- cgit v1.1