From 74263db28a7ef281684bc1f55120b57fd8c49623 Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Fri, 13 Jun 2008 14:13:33 +0200 Subject: [PATCH] gitstats: Improved the test descriptions The test descriptions were not very coherent. Instead of following a specific format, most tests didn't follow any description format at all. The current description format is as follows: 'Test that "function []" [works|filters] as expected [for ]' In the case that a test is only there to point out an untested option, the message should be as follows instead: 'There is no test for "function []"' --- src/t/t8100-stats.sh | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/t/t8100-stats.sh b/src/t/t8100-stats.sh index 6f06465..e7b4f7d 100755 --- a/src/t/t8100-stats.sh +++ b/src/t/t8100-stats.sh @@ -32,7 +32,7 @@ test_expect_success setup ' test_must_fail stats.py ' -test_expect_success 'Verify that the expected tree was created' ' +test_expect_success 'Test that the expected tree was created by setupRepo' ' test `git rev-parse HEAD` = "72224f7dd1549afc56a33851afa32d70144ced4b" ' @@ -47,7 +47,9 @@ test_expect_success 'Verify that the expected tree was created' ' echo "content.txt = 23: +23 -1" } > expected -test_expect_success 'Verify that author filters the result properly' ' +test_expect_success \ +'Test that "author -d" filters as expected for the primary author' \ +' stats.py author -d "author@example.com" > actual test_cmp expected actual ' @@ -56,7 +58,9 @@ test_expect_success 'Verify that author filters the result properly' ' echo "content.txt = 2: +2 -0" } > expected -test_expect_success 'Verify that the secondary authors result is filtered properly' ' +test_expect_success \ +'Test that "author -d" filters as expected for the secondary author' \ +' stats.py author -d "roh.tua@example.com" > actual test_cmp expected actual ' @@ -64,7 +68,7 @@ test_expect_success 'Verify that the secondary authors result is filtered proper rm expected touch expected -test_expect_failure 'Verify that the output for authors is aggregated properly' ' +test_expect_failure 'Test that "author -a" aggregates as expected' ' `stats.py author -a` > actual test_must_fail test_cmp expected actual ' @@ -78,7 +82,7 @@ test_expect_failure 'Verify that the output for authors is aggregated properly' echo "pu" } > expected -test_expect_success 'Test that the branch filter works as expected' ' +test_expect_success 'Test that "branch -c" filters as expected' ' stats.py branch -c 6f01ab2afb8471d6eee83162ddeabe179e443d59 > actual test_cmp expected actual ' @@ -90,13 +94,13 @@ test_expect_success 'Test that the branch filter works as expected' ' } > expected test_expect_success \ -'Test that the branch filter works when multiple branches match' \ +'Test that "branch -c" filters as expected when multiple branches match' \ ' stats.py branch -c c0e49264fd921d2a62f90556340e371e719b45cc > actual test_cmp expected actual ' -test_expect_failure 'Test that there is a test for the branch -r switch' ' +test_expect_failure 'There is no test for "branch -r"' ' `false` ' @@ -131,12 +135,12 @@ Date: Thu May 26 23:30:00 2005 +0000 notes.txt " > expected -test_expect_success 'Test that commit --contains option filters properly' ' +test_expect_success 'Test that "commit -t" filters as expected' ' stats.py commit -t notes.txt > actual test_cmp expected actual ' -test_expect_failure 'Test that there is a test for the commit -r switch' ' +test_expect_failure 'There is no test for "commit -r"' ' `false` ' @@ -149,12 +153,12 @@ Date: Thu May 26 23:30:00 2005 +0000 content.txt " > expected -test_expect_success 'Test that the --log option filters properly' ' +test_expect_success 'Test that "commit --log" filters as expected' ' stats.py commit --log-contains=Initial > actual test_cmp expected actual ' -test_expect_success 'Test that the --diff option filters properly' ' +test_expect_success 'Test that "commit --diff" filters as expected' ' stats.py commit --diff-contains=Initial > actual test_cmp expected actual ' @@ -168,7 +172,9 @@ test_expect_success 'Test that the --diff option filters properly' ' echo "Missing the following keys: ('/dev/null', 'b/notes.txt')" > expected -test_expect_success 'Test that two equal diffs in different files are not equal' ' +test_expect_success \ +'Test that "diff -e" works as expected for equal diffs in different files' \ +' stats.py diff -e bd9520628910101 3c34aec51560970c > actual test_cmp expected actual ' @@ -176,25 +182,27 @@ test_expect_success 'Test that two equal diffs in different files are not equal' echo "Missing the following keys: ('/dev/null', 'b/test.c')" > expected -test_expect_success 'Test that two equal diffs in different files are not equal' ' +test_expect_success \ +'Test that "diff -e" works as expected for equal diffs in different files' \ +' stats.py diff -e 3c34aec51560970c bd9520628910101 > actual test_cmp expected actual ' echo "Equal" > expected -test_expect_success 'Test that two equal diffs are equal' ' +test_expect_success 'Test that "diff -e" works as expected for equal diffs' ' stats.py diff -e HEAD HEAD > actual test_cmp expected actual ' -test_expect_failure 'Test that there are tests to test the -n option' ' +test_expect_failure 'There is no test for "diff -n"' ' `false` ' echo "Equal" > expected -test_expect_success 'Test that the -i option detects reverts as equal' ' +test_expect_success 'Test that "diff -i" works as expected for reverts' ' stats.py diff -i -e cc2d11f96d7ec43 c2d26c33f9e8eb6 > actual test_cmp expected actual ' @@ -236,7 +244,7 @@ notes.txt " > expected test_expect_success \ -'Test that when adding files to the index the changes show up properly' \ +'Test that "index -t" works as expected when there are staged changes' \ ' stats.py index -t > actual test_cmp expected actual @@ -246,7 +254,7 @@ test_expect_success 'index test teardown' ' git reset --hard HEAD ' -test_expect_failure 'Test that there is a test for the -a option' ' +test_expect_failure 'There is no test for "index -a"' ' `false` ' -- 2.11.4.GIT