@matheusbsbs / matheus-bagliano / commits / d930508903
Fork 0

t/t4202-log.sh: Add testcases

Add testcases for 'git log --diff-filter=[CM]' (copies and renames). Also add a testcase for 'git log --follow'. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Arjen Laarhoven committed Jan 22, 2009 at 17:37 UTC d930508903909ad5e700dd25e3858a1b2d69ed12
1 file changed +50 -9
t/t4202-log.sh
+50 -9
@@ -16,27 +16,31 @@ test_expect_success setup '
16 test_tick &&
17 git commit -m second &&
18
19 - mkdir a &&
20 - echo ni >a/two &&
21 - git add a/two &&
19 + git mv one ichi &&
20 test_tick &&
21 git commit -m third &&
22
25 - echo san >a/three &&
26 - git add a/three &&
23 + cp ichi ein &&
24 + git add ein &&
25 test_tick &&
26 git commit -m fourth &&
27
30 - git rm a/three &&
28 + mkdir a &&
29 + echo ni >a/two &&
30 + git add a/two &&
31 + test_tick &&
32 + git commit -m fifth &&
33 +
34 + git rm a/two &&
35 test_tick &&
32 - git commit -m fifth
36 + git commit -m sixth
37
38 '
39
40 test_expect_success 'diff-filter=A' '
41
42 actual=$(git log --pretty="format:%s" --diff-filter=A HEAD) &&
39 - expect=$(echo fourth ; echo third ; echo initial) &&
43 + expect=$(echo fifth ; echo fourth ; echo third ; echo initial) &&
44 test "$actual" = "$expect" || {
45 echo Oops
46 echo "Actual: $actual"
@@ -60,7 +64,43 @@ test_expect_success 'diff-filter=M' '
64 test_expect_success 'diff-filter=D' '
65
66 actual=$(git log --pretty="format:%s" --diff-filter=D HEAD) &&
63 - expect=$(echo fifth) &&
67 + expect=$(echo sixth ; echo third) &&
68 + test "$actual" = "$expect" || {
69 + echo Oops
70 + echo "Actual: $actual"
71 + false
72 + }
73 +
74 +'
75 +
76 +test_expect_success 'diff-filter=R' '
77 +
78 + actual=$(git log -M --pretty="format:%s" --diff-filter=R HEAD) &&
79 + expect=$(echo third) &&
80 + test "$actual" = "$expect" || {
81 + echo Oops
82 + echo "Actual: $actual"
83 + false
84 + }
85 +
86 +'
87 +
88 +test_expect_success 'diff-filter=C' '
89 +
90 + actual=$(git log -C -C --pretty="format:%s" --diff-filter=C HEAD) &&
91 + expect=$(echo fourth) &&
92 + test "$actual" = "$expect" || {
93 + echo Oops
94 + echo "Actual: $actual"
95 + false
96 + }
97 +
98 +'
99 +
100 +test_expect_success 'git log --follow' '
101 +
102 + actual=$(git log --follow --pretty="format:%s" ichi) &&
103 + expect=$(echo third ; echo second ; echo initial) &&
104 test "$actual" = "$expect" || {
105 echo Oops
106 echo "Actual: $actual"
@@ -72,6 +112,7 @@ test_expect_success 'diff-filter=D' '
112 test_expect_success 'setup case sensitivity tests' '
113 echo case >one &&
114 test_tick &&
115 + git add one
116 git commit -a -m Second
117 '
118