From: John Keeping <john@keeping.me.uk>
To: git@vger.kernel.org
Cc: Johannes Sixt <j.sixt@viscovery.net>,
David Aguilar <davvid@gmail.com>,
Sitaram Chamarty <sitaramc@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
Jonathan Nieder <jrnieder@gmail.com>,
John Keeping <john@keeping.me.uk>
Subject: [PATCH v2 1/3] t7800: don't hide grep output
Date: Sat, 23 Mar 2013 13:31:39 +0000 [thread overview]
Message-ID: <49f774ea5b09afb97945f7f1ba93b5c01e2c3dcf.1364045138.git.john@keeping.me.uk> (raw)
In-Reply-To: <cover.1364045138.git.john@keeping.me.uk>
In-Reply-To: <cover.1364045138.git.john@keeping.me.uk>
Remove the stdin_contains and stdin_doesnt_contain helper functions
which add nothing but hide the output of grep, hurting debugging.
Suggested-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: John Keeping <john@keeping.me.uk>
---
t/t7800-difftool.sh | 44 +++++++++++++++++---------------------------
1 file changed, 17 insertions(+), 27 deletions(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 3aab6e1..e694972 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -23,16 +23,6 @@ prompt_given ()
test "$prompt" = "Launch 'test-tool' [Y/n]: branch"
}
-stdin_contains ()
-{
- grep >/dev/null "$1"
-}
-
-stdin_doesnot_contain ()
-{
- ! stdin_contains "$1"
-}
-
# Create a file on master and change it on branch
test_expect_success PERL 'setup' '
echo master >file &&
@@ -296,24 +286,24 @@ test_expect_success PERL 'setup with 2 files different' '
test_expect_success PERL 'say no to the first file' '
(echo n && echo) >input &&
git difftool -x cat branch <input >output &&
- stdin_contains m2 <output &&
- stdin_contains br2 <output &&
- stdin_doesnot_contain master <output &&
- stdin_doesnot_contain branch <output
+ grep m2 output &&
+ grep br2 output &&
+ ! grep master output &&
+ ! grep branch output
'
test_expect_success PERL 'say no to the second file' '
(echo && echo n) >input &&
git difftool -x cat branch <input >output &&
- stdin_contains master <output &&
- stdin_contains branch <output &&
- stdin_doesnot_contain m2 <output &&
- stdin_doesnot_contain br2 <output
+ grep master output &&
+ grep branch output &&
+ ! grep m2 output &&
+ ! grep br2 output
'
test_expect_success PERL 'difftool --tool-help' '
git difftool --tool-help >output &&
- stdin_contains tool <output
+ grep tool output
'
test_expect_success PERL 'setup change in subdirectory' '
@@ -330,28 +320,28 @@ test_expect_success PERL 'setup change in subdirectory' '
test_expect_success PERL 'difftool -d' '
git difftool -d --extcmd ls branch >output &&
- stdin_contains sub <output &&
- stdin_contains file <output
+ grep sub output &&
+ grep file output
'
test_expect_success PERL 'difftool --dir-diff' '
git difftool --dir-diff --extcmd ls branch >output &&
- stdin_contains sub <output &&
- stdin_contains file <output
+ grep sub output &&
+ grep file output
'
test_expect_success PERL 'difftool --dir-diff ignores --prompt' '
git difftool --dir-diff --prompt --extcmd ls branch >output &&
- stdin_contains sub <output &&
- stdin_contains file <output
+ grep sub output &&
+ grep file output
'
test_expect_success PERL 'difftool --dir-diff from subdirectory' '
(
cd sub &&
git difftool --dir-diff --extcmd ls branch >output &&
- stdin_contains sub <output &&
- stdin_contains file <output
+ grep sub output &&
+ grep file output
)
'
--
1.8.2.324.ga64ebd9
next prev parent reply other threads:[~2013-03-23 13:32 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 4:03 [PATCH v3 1/4] difftool: silence uninitialized variable warning David Aguilar
2013-02-21 4:03 ` [PATCH 2/4] t7800: update copyright notice David Aguilar
2013-02-21 4:03 ` [PATCH v3 3/4] t7800: modernize tests David Aguilar
2013-02-21 4:03 ` [PATCH v3 4/4] t7800: "defaults" is no longer a builtin tool name David Aguilar
2013-02-21 4:55 ` Junio C Hamano
2013-02-21 5:00 ` Junio C Hamano
2013-02-21 23:31 ` David Aguilar
2013-03-20 9:48 ` [PATCH v3 3/4] t7800: modernize tests Johannes Sixt
2013-03-20 22:59 ` David Aguilar
2013-03-21 7:41 ` Johannes Sixt
2013-03-22 7:13 ` Johannes Sixt
2013-03-22 10:00 ` John Keeping
2013-03-22 11:14 ` Johannes Sixt
2013-03-22 11:53 ` John Keeping
2013-03-22 19:36 ` [PATCH 0/3] Improve difftool --dir-diff tests John Keeping
2013-03-22 19:36 ` [PATCH 1/3] t7800: don't hide grep output John Keeping
2013-03-22 22:32 ` Johannes Sixt
2013-03-22 22:45 ` Junio C Hamano
2013-03-22 19:36 ` [PATCH 2/3] t7800: fix tests when difftool uses --no-symlinks John Keeping
2013-03-22 22:27 ` Johannes Sixt
2013-03-22 22:53 ` Junio C Hamano
2013-03-22 23:05 ` John Keeping
2013-03-23 3:24 ` David Aguilar
2013-03-22 19:36 ` [PATCH 3/3] t7800: run --dir-diff tests with and without symlinks John Keeping
2013-03-22 21:05 ` [PATCH 3/3 v2] " John Keeping
2013-03-23 13:31 ` [PATCH v2 0/3] difftool --dir-diff test improvements John Keeping
2013-03-23 13:31 ` John Keeping [this message]
2013-03-23 13:31 ` [PATCH v2 2/3] t7800: fix tests when difftool uses --no-symlinks John Keeping
2013-03-24 5:19 ` Junio C Hamano
2013-03-24 12:36 ` John Keeping
2013-03-24 13:31 ` Matt McClure
2013-03-24 15:15 ` John Keeping
2013-03-25 7:41 ` Johannes Sixt
2013-03-25 10:42 ` John Keeping
2013-03-25 21:44 ` [PATCH v2] difftool: don't overwrite modified files John Keeping
2013-03-26 8:38 ` Johannes Sixt
2013-03-26 8:47 ` Johannes Sixt
2013-03-26 9:31 ` John Keeping
2013-03-26 9:53 ` Johannes Sixt
2013-03-26 19:34 ` John Keeping
2013-03-26 20:52 ` Matt McClure
2013-03-26 21:01 ` John Keeping
2013-03-25 16:15 ` [PATCH v2 2/3] t7800: fix tests when difftool uses --no-symlinks Junio C Hamano
2013-03-24 21:29 ` David Aguilar
2013-03-25 10:57 ` John Keeping
2013-03-25 14:54 ` Junio C Hamano
2013-03-24 13:24 ` Matt McClure
2013-03-24 6:20 ` Eric Sunshine
2013-03-23 13:31 ` [PATCH v2 3/3] t7800: run --dir-diff tests with and without symlinks John Keeping
2013-03-25 7:26 ` Johannes Sixt
2013-03-25 10:35 ` John Keeping
2013-03-25 10:59 ` Johannes Sixt
2013-03-25 11:02 ` John Keeping
2013-03-25 21:50 ` Junio C Hamano
2013-03-26 9:22 ` John Keeping
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49f774ea5b09afb97945f7f1ba93b5c01e2c3dcf.1364045138.git.john@keeping.me.uk \
--to=john@keeping.me.uk \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=jrnieder@gmail.com \
--cc=sitaramc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).