aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/test/script/parser/regex.test
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/test/script/parser/regex.test')
-rw-r--r--unit-tests/test/script/parser/regex.test115
1 files changed, 67 insertions, 48 deletions
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
:
$* <<EOI 2>>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
:
$* <<EOI 2>>EOE != 0
cmd >>~/EOO/
- /x
- EOO
- EOI
- testscript:2:1: error: invalid line-regex syntax character 'x'
- EOE
-
- : invalid-char-regex
- :
- $* <<EOI 2>>~/EOE/ != 0
- cmd >>~/EOO/
- /foo[/
- EOO
- EOI
- /testscript:2:1: error: invalid regex.*/
- EOE
-
- : invalid-line-regex
- :
- $* <<EOI 2>>~/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
:
$* <<EOI >>EOO
cmd 2>>~/EOE/
@@ -184,6 +162,47 @@
//*
EOE
EOO
+
+ : no-newline
+ :
+ $* <'cmd >:~/fo*/' >'cmd >:~/fo*/'
+ $* <<EOI >>EOO
+ cmd 2>>:~/EOE/
+ foo
+ EOE
+ EOI
+ cmd 2>>:~/EOE/
+ foo
+ EOE
+ EOO
+
+ : end-marker-restore
+ :
+ {
+ : idot
+ :
+ $* <<EOI >>EOO
+ cmd 2>>~/EOE/d
+ foo
+ EOE
+ EOI
+ cmd 2>>~/EOE/d
+ foo
+ EOE
+ EOO
+
+ : icase
+ :
+ $* <<EOI >>EOO
+ cmd 2>>~/EOE/i
+ foo
+ EOE
+ EOI
+ cmd 2>>~/EOE/i
+ foo
+ EOE
+ EOO
+ }
}
: stderr