3 # Copyright (c) 2008 Sverre Rabbelier
6 test_description
='stats tests (basics)
8 This test verifies that the basic stats commands work as expected.'
14 test_expect_success pre-clean
'
15 rm -fr "/tmp/freshrepo" || {
17 echo >&5 "FATAL: Cannot clean the fresh repo"
22 test_expect_success setup
'
23 ../../scripts/setupRepo.py
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"
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"
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_success
'Teardown' '