summaryrefslogtreecommitdiff
path: root/t/t0008-ignores.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-11-04 14:58:19 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-11-04 14:58:20 -0800
commit944adac909185f8bf2fe13be53b6768ed7d7b0ff (patch)
tree69b30018b466d168f6b3eb7b97f586ec3c988572 /t/t0008-ignores.sh
parentMerge branch 'vd/doc-unpack-objects' (diff)
parentt4015: simplify sed command that is not even seen by sed (diff)
downloadtgif-944adac909185f8bf2fe13be53b6768ed7d7b0ff.tar.xz
Merge branch 'bw/solaris-sed-tr-test-portability'
* bw/solaris-sed-tr-test-portability: t4015: simplify sed command that is not even seen by sed Avoid difference in tr semantics between System V and BSD Change sed i\ usage to something Solaris' sed can handle
Diffstat (limited to 't/t0008-ignores.sh')
-rwxr-xr-xt/t0008-ignores.sh30
1 files changed, 18 insertions, 12 deletions
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 181513ab4f..b4d98e602f 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -37,6 +37,14 @@ test_stderr () {
test_cmp "$HOME/expected-stderr" "$HOME/stderr"
}
+broken_c_unquote () {
+ "$PERL_PATH" -pe 's/^"//; s/\\//; s/"$//; tr/\n/\0/' "$@"
+}
+
+broken_c_unquote_verbose () {
+ "$PERL_PATH" -pe 's/ "/ /; s/\\//; s/"$//; tr/:\t\n/\0/' "$@"
+}
+
stderr_contains () {
regexp="$1"
if grep "$regexp" "$HOME/stderr"
@@ -606,12 +614,11 @@ cat <<-EOF >expected-verbose
$global_excludes:2:!globaltwo b/globaltwo
EOF
-sed -e 's/^"//' -e 's/\\//' -e 's/"$//' stdin | \
- tr "\n" "\0" >stdin0
-sed -e 's/^"//' -e 's/\\//' -e 's/"$//' expected-default | \
- tr "\n" "\0" >expected-default0
-sed -e 's/ "/ /' -e 's/\\//' -e 's/"$//' expected-verbose | \
- tr ":\t\n" "\0" >expected-verbose0
+broken_c_unquote stdin >stdin0
+
+broken_c_unquote expected-default >expected-default0
+
+broken_c_unquote_verbose expected-verbose >expected-verbose0
test_expect_success '--stdin' '
expect_from_stdin <expected-default &&
@@ -692,12 +699,11 @@ EOF
grep -v '^:: ' expected-all >expected-verbose
sed -e 's/.* //' expected-verbose >expected-default
-sed -e 's/^"//' -e 's/\\//' -e 's/"$//' stdin | \
- tr "\n" "\0" >stdin0
-sed -e 's/^"//' -e 's/\\//' -e 's/"$//' expected-default | \
- tr "\n" "\0" >expected-default0
-sed -e 's/ "/ /' -e 's/\\//' -e 's/"$//' expected-verbose | \
- tr ":\t\n" "\0" >expected-verbose0
+broken_c_unquote stdin >stdin0
+
+broken_c_unquote expected-default >expected-default0
+
+broken_c_unquote_verbose expected-verbose >expected-verbose0
test_expect_success '--stdin from subdirectory' '
expect_from_stdin <expected-default &&