From a83f3866667bca073c4d4c5d80b4deb5ac05906c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 11 Jan 2017 01:43:09 +0300 Subject: Add support for portable path modifer and dot character escaping inversion --- unit-tests/test/script/parser/regex.test | 115 ++++++++++++++++++------------- 1 file changed, 67 insertions(+), 48 deletions(-) (limited to 'unit-tests/test/script/parser/regex.test') diff --git a/unit-tests/test/script/parser/regex.test b/unit-tests/test/script/parser/regex.test index f9101c9..058a5bc 100644 --- a/unit-tests/test/script/parser/regex.test +++ b/unit-tests/test/script/parser/regex.test @@ -26,12 +26,30 @@ testscript:1:7: error: no closing introducer character in stdout regex redirect EOE + : portable-path-introducer + : + $* <'cmd >/~/foo/' 2>>EOE != 0 + testscript:1:8: error: portable path modifier and '/' introducer in stdout regex redirect + EOE + : empty : $* <'cmd >~//' 2>>EOE != 0 testscript:1:7: error: stdout regex redirect is empty EOE + : no-flags + : + $* <'cmd >~/fo*/' >'cmd >~/fo*/' + + : idot + : + $* <'cmd >~/fo*/d' >'cmd >~/fo*/d' + + : icase + : + $* <'cmd >~/fo*/i' >'cmd >~/fo*/i' + : invalid-flags1 : $* <'cmd >~/foo/z' 2>>EOE != 0 @@ -44,24 +62,6 @@ testscript:1:7: error: junk at the end of stdout regex redirect EOE - : malformed - : - : Note that old versions of libc++ (for example 1.1) do not detect some - : regex errors. For example '*' is parsed successfully. - : - $* <'cmd >~/foo[/' 2>>~/EOE/ != 0 - /testscript:1:7: error: invalid stdout regex redirect.*/ - info: regex: /foo[/ - EOE - - : without-flags - : - $* <'cmd >~/fo*/' >'cmd >~/fo*/' - - : with-flags - : - $* <'cmd >~/fo*/i' >'cmd >~/fo*/i' - : no-newline : $* <'cmd >:~/fo*/' >'cmd >:~/fo*/' @@ -106,46 +106,24 @@ testscript:1:8: error: expected here-document regex end marker EOE - : unterminated-line-char + : portable-path-introducer : $* <>EOE != 0 - cmd >>~/EOO/ - / + cmd >>/~/EOO/ + foo EOO EOI - testscript:2:1: error: regex introducer without regex - info: consider changing regex introducer '/' in here-document end marker + testscript:1:5: error: portable path modifier and '/' introducer in here-document regex end marker EOE - : invalid-syntax-char + : unterminated-line-char : $* <>EOE != 0 cmd >>~/EOO/ - /x - EOO - EOI - testscript:2:1: error: invalid line-regex syntax character 'x' - EOE - - : invalid-char-regex - : - $* <>~/EOE/ != 0 - cmd >>~/EOO/ - /foo[/ - EOO - EOI - /testscript:2:1: error: invalid regex.*/ - EOE - - : invalid-line-regex - : - $* <>~/EOE/ != 0 - cmd >>~/EOO/ - a - /{ + / EOO EOI - /testscript:4:1: error: invalid here-document regex.*/ + testscript:2:1: error: no syntax line characters EOE : empty @@ -157,7 +135,7 @@ testscript:2:1: error: empty here-document regex EOE - : valid + : no-flags : $* <>EOO cmd 2>>~/EOE/ @@ -184,6 +162,47 @@ //* EOE EOO + + : no-newline + : + $* <'cmd >:~/fo*/' >'cmd >:~/fo*/' + $* <>EOO + cmd 2>>:~/EOE/ + foo + EOE + EOI + cmd 2>>:~/EOE/ + foo + EOE + EOO + + : end-marker-restore + : + { + : idot + : + $* <>EOO + cmd 2>>~/EOE/d + foo + EOE + EOI + cmd 2>>~/EOE/d + foo + EOE + EOO + + : icase + : + $* <>EOO + cmd 2>>~/EOE/i + foo + EOE + EOI + cmd 2>>~/EOE/i + foo + EOE + EOO + } } : stderr -- cgit v1.1