aboutsummaryrefslogtreecommitdiff
path: root/tests/sed.test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-02-17 19:21:44 -0600
committerRob Landley <rob@landley.net>2016-02-17 19:21:44 -0600
commit32b3587af261c2fb416f5de1be8f00fd5c1283d5 (patch)
treee90d46583887f3dbf614130885526a85a76e9581 /tests/sed.test
parentb66a29ab58c686c98ab9683c5c544f40a1ea35f5 (diff)
downloadtoybox-32b3587af261c2fb416f5de1be8f00fd5c1283d5.tar.gz
The perl build's attempt to escape spaces and such in LD_LIBRARY_PATH is _SAD_.
It uses a sed expression that assumes you can escape - to use it as a literal (you can't, it has to be first or last char of the range), and assumes you have to escape delimiters in sed [] context (you don't), and/or that non-printf escapes become the literal character (they don't, the backslash is preserved as a literal), meaning it winds up doing "s/[\-\]//" which is a length 1 range, which is officially undefined behavior according to posix, and regcomp errors out. But if we don't accept it (like other implementations do) the perl build breaks. So collapse [A-A] into just [A]. Testcae taken from perl 5.22.0 file Makefile.SH line 8. (While we're at it, remove an unused argument from a function.)
Diffstat (limited to 'tests/sed.test')
-rwxr-xr-xtests/sed.test6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/sed.test b/tests/sed.test
index eff2306a..c62f9c4d 100755
--- a/tests/sed.test
+++ b/tests/sed.test
@@ -131,10 +131,13 @@ hello'" "merp\nhello\n" "" "merp"
testing "" "sed -e '/x/c\' -e 'y'" 'y\n' '' 'x\n'
testing "" "sed -e 's/a[([]*b/X/'" 'X' '' 'a[(b'
+testing "" "sed 'y/a\\bc/de\f/'" "db\f" "" "abc"
+testing "sed [a-a] (for perl)" "sed '"'s/\([^a-zA-Z0-9.:_\-\/]\)/\\\1/g'"'" \
+ 'he\ llo' "" "he llo"
# You have to match the first line of a range in order to activate
# the range, numeric and ascii work the same way
-testing "skip start of range" "sed -e n -e '1,2s/b/c/'" "a\nb\n" "" "a\nb\n"
+testing "sed skip start of range" "sed -e n -e '1,2s/b/c/'" "a\nb\n" "" "a\nb\n"
#echo meep | sed/sed -e '1a\' -e 'huh'
#echo blah | sed/sed -f <(echo -e "1a\\\\\nboom")
@@ -146,4 +149,5 @@ testing "sed bonus backslashes" \
"hello\nl x\nab\nc\n" "" "hello\n"
# -i with $ last line test
+
exit $FAILCOUNT