From 5583ffaa2581858cb7f7f75e28660bc038bcc8ec Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 1 Nov 2016 12:18:59 +0300 Subject: Add support for cleanup types to testscript parser --- unit-tests/test/script/lexer/command-line.test | 13 +++++++++---- unit-tests/test/script/lexer/script-line.test | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) (limited to 'unit-tests/test/script/lexer') diff --git a/unit-tests/test/script/lexer/command-line.test b/unit-tests/test/script/lexer/command-line.test index bc791dc..acb7d1d 100644 --- a/unit-tests/test/script/lexer/command-line.test +++ b/unit-tests/test/script/lexer/command-line.test @@ -118,12 +118,17 @@ $* <:"1>>>&a b" >>EOO # out-file-app-redirect 'a b' EOO -$* <:"&file" >>EOO # file-cleanup +$* <:"&file" >>EOO # cleanup-always & 'file' EOO -$* <:"&dir/" >>EOO # dir-cleanup -& -'dir/' +$* <:"&?file" >>EOO # cleanup-maybe +&? +'file' +EOO + +$* <:"&!file" >>EOO # cleanup-never +&! +'file' EOO diff --git a/unit-tests/test/script/lexer/script-line.test b/unit-tests/test/script/lexer/script-line.test index 96eb19c..44f6002 100644 --- a/unit-tests/test/script/lexer/script-line.test +++ b/unit-tests/test/script/lexer/script-line.test @@ -112,11 +112,23 @@ $* <"cmd <<>>out 2>>>&err" >>EOO # file-redirect EOO -$* <"cmd &file &dir/" >>EOO # cleanup +$* <"cmd &file" >>EOO # cleanup-always 'cmd' & 'file' -& -'dir/' + +EOO + +$* <"cmd &?file" >>EOO # cleanup-maybe +'cmd' +&? +'file' + +EOO + +$* <"cmd &!file" >>EOO # cleanup-never +'cmd' +&! +'file' EOO -- cgit v1.1