From: Lucian Poston Date: Wed, 18 Apr 2012 02:29:49 GMT Subject: [PATCH v4 3/4] t4052: Test diff-stat output with minimum columns Message-ID: <1334716196-9870-3-git-send-email-lucian.poston@gmail.com> In-Reply-To: <1334716196-9870-1-git-send-email-lucian.poston@gmail.com> When COLUMNS or --stat-width restricts the diff-stat width to near the minimum, 26 columns, the graph_width value becomes negative. Consequently, the graph part of diff-stat is not resized properly. Signed-off-by: Lucian Poston --- t/t4052-stat-output.sh | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh index d748e5e..6305c99 100755 --- a/t/t4052-stat-output.sh +++ b/t/t4052-stat-output.sh @@ -284,6 +284,34 @@ respects expect200 show --stat respects expect200 log -1 --stat EOF +cat >expect1 <<'EOF' + ...aaaaaaa | 1000 ++++++ +EOF +cat >expect1-graph <<'EOF' +| ...aaaaaaa | 1000 ++++++ +EOF +while read verb expect cmd args +do + test_expect_failure "$cmd $verb prefix greater than COLUMNS (big change)" ' + COLUMNS=1 git $cmd $args >output + grep " | " output >actual && + test_cmp "$expect" actual + ' + + test "$cmd" != diff || continue + + test_expect_failure "$cmd --graph $verb prefix greater than COLUMNS (big change)" ' + COLUMNS=1 git $cmd $args --graph >output + grep " | " output >actual && + test_cmp "$expect-graph" actual + ' +done <<\EOF +ignores expect80 format-patch -1 --stdout +respects expect1 diff HEAD^ HEAD --stat +respects expect1 show --stat +respects expect1 log -1 --stat +EOF + cat >expect <<'EOF' abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ EOF -- 1.7.3.4