git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Kufner <josef@kufner.cz>
To: git@vger.kernel.org
Cc: Josef Kufner <josef@kufner.cz>
Subject: [PATCH] Add tests for "Pass graph width to pretty formatting, so '%>|' can work properly"
Date: Fri, 11 Sep 2015 19:50:45 +0200	[thread overview]
Message-ID: <1441993845-25778-1-git-send-email-josef@kufner.cz> (raw)
In-Reply-To: <xmqq1te428xl.fsf@gitster.mtv.corp.google.com>

---
 t/t4205-log-pretty-formats.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 7398605..3358837 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -319,6 +319,18 @@ EOF
 	test_cmp expected actual
 '
 
+# Note: Space between 'message' and 'two' should be in the same column as in previous test.
+test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' '
+	git -c i18n.logOutputEncoding=$test_encoding log --graph --pretty="tformat:%h %>|(40)%s" >actual &&
+	qz_to_tab_space <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
+* $head1                    message two
+* $head2                    message one
+* $head3                        add bar
+* $head4            $(commit_msg)
+EOF
+	test_cmp expected actual
+'
+
 test_expect_success 'right alignment formatting with no padding' '
 	git log --pretty="tformat:%>(1)%s" >actual &&
 	cat <<EOF >expected &&
@@ -330,6 +342,17 @@ EOF
 	test_cmp expected actual
 '
 
+test_expect_success 'right alignment formatting with no padding and with --graph' '
+	git log --graph --pretty="tformat:%>(1)%s" >actual &&
+	cat <<EOF >expected &&
+* message two
+* message one
+* add bar
+* $(commit_msg)
+EOF
+	test_cmp expected actual
+'
+
 test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' '
 	git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual &&
 	cat <<EOF | iconv -f utf-8 -t $test_encoding >expected &&
-- 
2.5.1

  reply	other threads:[~2015-09-11 17:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11 13:47 [PATCH] Pass graph width to pretty formatting, so '%>|' can work properly Josef Kufner
2015-09-11 16:54 ` Junio C Hamano
2015-09-11 17:50   ` Josef Kufner [this message]
2015-09-11 19:37     ` [PATCH] Add tests for "Pass graph width to pretty formatting, so '%>|' can work properly" Eric Sunshine
2015-09-11 20:19       ` Junio C Hamano
2015-09-11 20:22       ` Josef Kufner
2015-09-11 20:25       ` Josef Kufner
2015-09-11 17:52   ` [PATCH] Pass graph width to pretty formatting, so '%>|' can work properly Josef Kufner

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=1441993845-25778-1-git-send-email-josef@kufner.cz \
    --to=josef@kufner.cz \
    --cc=git@vger.kernel.org \
    /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).