summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2010-07-01 17:02:03 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2010-07-01 17:02:03 +0000
commit3269b215277e7b004ef6c5cb1b64da4552cc625c (patch)
treea1c15efe9502eba9c62f6ff880bf07b54b76f7d8 /regress
parent4375a386c1c72d45d24234a7738742e4cfcb6ecc (diff)
Allow [ to be used as a delimiter.
From FreeBSD; ok millert@ halex@
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/sed/sedtest.expected55
-rw-r--r--regress/usr.bin/sed/sedtest.sh10
2 files changed, 64 insertions, 1 deletions
diff --git a/regress/usr.bin/sed/sedtest.expected b/regress/usr.bin/sed/sedtest.expected
index 744527154a1..38a934093ff 100644
--- a/regress/usr.bin/sed/sedtest.expected
+++ b/regress/usr.bin/sed/sedtest.expected
@@ -4506,3 +4506,58 @@ XYeYff
XYeYYf
XYeYYY
XYeYYY
+[ as an s delimiter and its escapes
+
+=============
+Test 8.17:186
+=============
+l1X1
+l1X2
+l1X3
+l1X4
+l1X5
+l1X6
+l1X7
+l1X8
+l1X9
+l1X10
+l1X11
+l1X12
+l1X13
+l1X14
+
+=============
+Test 8.18:187
+=============
+X_1
+X_2
+X_3
+X_4
+X_5
+X_6
+X_7
+X_8
+X_9
+X_10
+X_11
+X_12
+X_13
+X_14
+
+=============
+Test 8.19:188
+=============
+X[_1
+X[_2
+X[_3
+X[_4
+X[_5
+X[_6
+X[_7
+X[_8
+X[_9
+X[_10
+X[_11
+X[_12
+X[_13
+X[_14
diff --git a/regress/usr.bin/sed/sedtest.sh b/regress/usr.bin/sed/sedtest.sh
index 669ad7596a7..f350dd736f0 100644
--- a/regress/usr.bin/sed/sedtest.sh
+++ b/regress/usr.bin/sed/sedtest.sh
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $OpenBSD: sedtest.sh,v 1.1 2008/10/10 14:33:34 millert Exp $
+# $OpenBSD: sedtest.sh,v 1.2 2010/07/01 17:02:02 naddy Exp $
#
# Copyright (c) 1992 Diomidis Spinellis.
# Copyright (c) 1992, 1993
@@ -407,6 +407,14 @@ u2/g' lines1
mark '8.15' ; $SED -e '1N;2y/\n/X/' lines1
mark '8.16'
echo 'eeefff' | $SED -e 'p' -e 's/e/X/p' -e ':x' -e 's//Y/p' -e '/f/bx'
+ echo '[ as an s delimiter and its escapes'
+ mark '8.17' ; $SED -e 's[_[X[' lines1
+# This is a matter of interpretation
+# POSIX 1003.1, 2004 says "Within the BRE and the replacement,
+# the BRE delimiter itself can be used as a *literal* character
+# if it is preceded by a backslash
+ mark '8.18' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X['
+ mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[['
}
test_error()