From 9cb992453d32e39f321fbc0940ed23a5e90e042c Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Tue, 24 Jun 2008 23:16:46 +0200 Subject: [PATCH] Use the new GIT_STATS_PRETTY_PRINT and added tags features With the modified pretty print it is now feasible to test commands with large output. --- src/t/t8100-stats.sh | 115 +++++++++++++++++++++------------------------------ 1 file changed, 46 insertions(+), 69 deletions(-) diff --git a/src/t/t8100-stats.sh b/src/t/t8100-stats.sh index 5f21c4e..710e320 100755 --- a/src/t/t8100-stats.sh +++ b/src/t/t8100-stats.sh @@ -11,6 +11,7 @@ ORIG_PATH=$PWD . ./test-lib.sh +export GIT_STATS_PRETTY_PRINT="oneline" ########### # Setup @@ -101,7 +102,7 @@ test_expect_failure 'Test that "author -a" aggregates as expected' ' } > expected test_expect_success 'Test that "branch -c" filters as expected' ' - stats.py branch -c 6f01ab2afb8471d6eee83162ddeabe179e443d59 > actual + stats.py branch -c v0 > actual test_cmp expected actual ' @@ -115,14 +116,14 @@ test_expect_success 'Test that "branch -c" filters as expected' ' test_expect_success \ 'Test that "branch -c" filters as expected when multiple branches match' \ ' - stats.py branch -c c0e49264fd921d2a62f90556340e371e719b45cc > actual + stats.py branch -c v1 > actual test_cmp expected actual ' echo "junio" >> expected test_expect_success 'Test that "branch -r" works as expected' ' - stats.py branch -r -c c0e49264fd921d2a62f90556340e371e719b45cc > actual + stats.py branch -r -c v1 > actual test_cmp expected actual ' @@ -132,30 +133,9 @@ test_expect_success 'Test that "branch -r" works as expected' ' ########### -echo "commit e76ad031836912c01da47ab93d3c21676763267e -Author: A U Thor -Date: Thu May 26 23:30:00 2005 +0000 - - Commit 3 - -notes.txt - -commit e8fa5fed0d1823c1e3e120579b03343aecf26ab6 -Author: A U Thor -Date: Thu May 26 23:30:00 2005 +0000 - - Commit 2 - -notes.txt - -commit bd952062891010102e3632aecd0f738a35c1fca3 -Author: A U Thor -Date: Thu May 26 23:30:00 2005 +0000 - - Commit 1 - -notes.txt -" > expected +echo "3b0e7ae64f1b39f7b23d789a9d472443dd00c6fb Commit 3 +9ae22dc6a76c6ac715cc9fe6a011156ca042f480 Commit 2 +ae9fd667fe1611e0648a2ebec65788b63bb3ce16 Commit 1" > expected test_expect_success 'Test that "commit -t" filters as expected' ' stats.py commit -t notes.txt > actual @@ -166,8 +146,20 @@ test_expect_success 'commit tests setup' ' cd docs ' +echo 'f1fdf284733011b1172b4517b4526879059bb414 Last commit +4de759680bf8bd7b51e3a0481d027ee441998542 Revert "Commit 6" +255ef82de488015b727e0202f0dfe8ed82443ebb Commit 6 +4838591dcda04acd0e8882397c5c681af09c9076 Revert "Last commit" +4b650481338f95cd8afbc113bd15cd85d94c0c3a Last commit +37837a72217f8da3f056d5aa8b159412b93efd69 Commit 5 +a03fc7e69239cc3e29c96ebf74e7d22e2d72bbef Commit 4 +39f4923417895119ac26524c572dbd198570f054 Commit 3 +3302051a5e010ede6cdb6d8fa66cff7e89f63b28 Commit 2 +7bd493f55b8b0b0c59c08ca5be7c8f98fb159885 Commit 1' > expected + test_expect_success 'Test that "commit -r" works as expected' ' - stats.py commit -r -t README.txt + stats.py commit -r -t README.txt > actual + test_cmp expected actual ' test_expect_success \ @@ -180,14 +172,7 @@ test_expect_success 'commit tests teardown' ' cd .. ' -echo "commit bc6d646fd15953cdb514d14458f013a1fc05153c -Author: A U Thor -Date: Thu May 26 23:30:00 2005 +0000 - - Initial commit - -content.txt -" > expected +echo "9ebfa8e247b99c0ba0198244d574734899dac987 Initial commit" > expected test_expect_success 'Test that "commit --log" filters as expected' ' stats.py commit --log-contains=Initial > actual @@ -206,22 +191,22 @@ test_expect_success 'Test that "commit --diff" filters as expected' ' echo "Missing the following keys: -('/dev/null', 'b/notes.txt')" > expected +('a/test.c', 'b/test.c')" > expected test_expect_success \ 'Test that "diff -e" works as expected for equal diffs in different files' \ ' - stats.py diff -e bd9520628910101 3c34aec51560970c > actual + stats.py diff -e v0 v4 > actual test_cmp expected actual ' echo "Missing the following keys: -('/dev/null', 'b/test.c')" > expected +('a/docs/README.txt', 'b/docs/README.txt')" > expected test_expect_success \ 'Test that "diff -e" works as expected for equal diffs in different files' \ ' - stats.py diff -e 3c34aec51560970c bd9520628910101 > actual + stats.py diff -e v4 v0 > actual test_cmp expected actual ' @@ -233,14 +218,14 @@ test_expect_success 'Test that "diff -e" works as expected for equal diffs' ' ' test_expect_success 'Test that "diff -n -e" works as expected' ' - stats.py diff -n -e 90511e146e24b29 38aa44905fb99a6 > actual + stats.py diff -n -e v2 v3 > actual test_cmp expected actual ' echo "Equal" > expected test_expect_success 'Test that "diff -i" works as expected for reverts' ' - stats.py diff -i -e cc2d11f96d7ec43 c2d26c33f9e8eb6 > actual + stats.py diff -i -e v2 v3^ > actual test_cmp expected actual ' @@ -255,30 +240,9 @@ test_expect_success 'index test setup' ' git add notes.txt ' -echo "commit e76ad031836912c01da47ab93d3c21676763267e -Author: A U Thor -Date: Thu May 26 23:30:00 2005 +0000 - - Commit 3 - -notes.txt - -commit e8fa5fed0d1823c1e3e120579b03343aecf26ab6 -Author: A U Thor -Date: Thu May 26 23:30:00 2005 +0000 - - Commit 2 - -notes.txt - -commit bd952062891010102e3632aecd0f738a35c1fca3 -Author: A U Thor -Date: Thu May 26 23:30:00 2005 +0000 - - Commit 1 - -notes.txt -" > expected +echo "3b0e7ae64f1b39f7b23d789a9d472443dd00c6fb Commit 3 +9ae22dc6a76c6ac715cc9fe6a011156ca042f480 Commit 2 +ae9fd667fe1611e0648a2ebec65788b63bb3ce16 Commit 1" > expected test_expect_success \ 'Test that "index -t" works as expected when there are staged changes' \ @@ -293,7 +257,7 @@ test_expect_success 'index test teardown' ' test_expect_success 'index -a test setup' ' git checkout erase - git reset --soft v2^ + git reset --soft v5^ ' { @@ -305,12 +269,25 @@ test_expect_success 'Test that "index -t" without -a works as expected' ' test_cmp expected actual ' +echo '28b2600cf58d478b4b937262218e363c88756b89 Deleted file docs/README.txt +f1fdf284733011b1172b4517b4526879059bb414 Last commit +4de759680bf8bd7b51e3a0481d027ee441998542 Revert "Commit 6" +255ef82de488015b727e0202f0dfe8ed82443ebb Commit 6 +4838591dcda04acd0e8882397c5c681af09c9076 Revert "Last commit" +4b650481338f95cd8afbc113bd15cd85d94c0c3a Last commit +37837a72217f8da3f056d5aa8b159412b93efd69 Commit 5 +a03fc7e69239cc3e29c96ebf74e7d22e2d72bbef Commit 4 +39f4923417895119ac26524c572dbd198570f054 Commit 3 +3302051a5e010ede6cdb6d8fa66cff7e89f63b28 Commit 2 +7bd493f55b8b0b0c59c08ca5be7c8f98fb159885 Commit 1' > expected + test_expect_success 'Test that "index -a" works as expected' ' - stats.py index -a -t + stats.py index -a -t > actual + test_cmp expected actual ' test_expect_success 'index -a test teardown' ' - git reset --hard v2 + git reset --hard v5 git checkout master ' -- 2.11.4.GIT