diff tests/test-diff-color.t @ 23172:e955549cd045

tests: write hgrc of more than two lines by using shell heredoc Here document should be readable than repeating echo commands.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 04 Nov 2014 23:41:46 +0900
parents 9ab18a912c44
children c84a07530040
line wrap: on
line diff
--- a/tests/test-diff-color.t	Tue Nov 04 10:40:06 2014 +0000
+++ b/tests/test-diff-color.t	Tue Nov 04 23:41:46 2014 +0900
@@ -1,9 +1,11 @@
 Setup
 
-  $ echo "[color]" >> $HGRCPATH
-  $ echo "mode = ansi" >> $HGRCPATH
-  $ echo "[extensions]" >> $HGRCPATH
-  $ echo "color=" >> $HGRCPATH
+  $ cat <<EOF >> $HGRCPATH
+  > [color]
+  > mode = ansi
+  > [extensions]
+  > color =
+  > EOF
   $ hg init repo
   $ cd repo
   $ cat > a <<EOF
@@ -66,11 +68,13 @@
   $ hg diff --stat --color=always
    a |  2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
    1 files changed, 1 insertions(+), 1 deletions(-)
-  $ echo "record=" >> $HGRCPATH
-  $ echo "[ui]" >> $HGRCPATH
-  $ echo "interactive=true" >> $HGRCPATH
-  $ echo "[diff]" >> $HGRCPATH
-  $ echo "git=True" >> $HGRCPATH
+  $ cat <<EOF >> $HGRCPATH
+  > record =
+  > [ui]
+  > interactive = true
+  > [diff]
+  > git = True
+  > EOF
 
 #if execbit