gitstats: Created a test case to point out an unimplemented function
[git-stats.git] / src / t / t8100-stats.sh
blob5d821abfbf713f217963b04040a0e0d6ca128083
1 #!/bin/sh
3 # Copyright (c) 2008 Sverre Rabbelier
6 test_description='stats tests (basics)
8 This test verifies that the basic stats commands work as expected.'
10 ORIG_PATH=$PWD
12 . ./test-lib.sh
14 test_expect_success pre-clean '
15 rm -fr "/tmp/freshrepo" || {
16 trap - exit
17 echo >&5 "FATAL: Cannot clean the fresh repo"
18 exit 1
22 test_expect_success setup '
23 ../../scripts/setupRepo.py
24 cd /tmp/freshrepo
25 PATH=../:$PATH
26 test_must_fail stats.py
29 test_expect_success 'Verify that the expected tree was created' '
30 test `git rev-parse HEAD` = "72224f7dd1549afc56a33851afa32d70144ced4b"
34 echo "notes.txt = 3: +3 -0"
35 echo "content.txt = 23: +23 -1"
36 } > expected
38 test_expect_success 'Verify that author filters the result properly' '
39 stats.py author -d "author@example.com" > actual
40 test_cmp expected actual
44 echo "content.txt = 2: +2 -0"
45 } > expected
47 test_expect_success 'Verify that the secondary authors result is filtered properly' '
48 stats.py author -d "roh.tua@example.com" > actual
49 test_cmp expected actual
52 test_expect_failure 'Verify that the output for authors is aggregated properly' '
53 test `stats.py author -a` != ""
56 test_expect_success 'Teardown' '
57 cd $ORIG_PATH
60 test_done