3 test_description='colored git blame'
7 . "$TEST_DIRECTORY"/annotate-tests.sh
9 test_expect_success 'colored blame colors contiguous lines' '
10 git blame --abbrev=12 --color-lines hello.c >actual.raw &&
11 test_decode_color <actual.raw >actual &&
12 grep "<BOLD;BLACK>(F" actual > F.expect &&
13 grep "<BOLD;BLACK>(H" actual > H.expect &&
14 test_line_count = 2 F.expect &&
15 test_line_count = 3 H.expect
18 test_expect_success 'colored blame colors continuous fields' '
20 git mv hello.c world.c &&
21 git commit -a -m "moved file" &&
22 cat <<-EOF >> world.c &&
29 GIT_AUTHOR_NAME="F" GIT_AUTHOR_EMAIL="F@test.git" \
30 git commit -m "forgot to add changes to moved file" &&
32 git blame --abbrev=12 --color-fields world.c >actual.raw &&
33 test_decode_color <actual.raw >actual &&
35 grep "<BOLD;BLACK>hello.c" actual > colored_hello.expect &&
36 grep "hello.c" actual > all_hello.expect &&
37 test_line_count = 9 colored_hello.expect &&
38 test_line_count = 10 all_hello.expect &&
40 grep "<BOLD;BLACK>world.c" actual > colored_world.expect &&
41 grep "world.c" actual > all_world.expect &&
42 test_line_count = 3 colored_world.expect &&
43 test_line_count = 4 all_world.expect &&
45 grep "(F" actual > all_F.expect &&
46 grep "<BOLD;BLACK>(F" actual > colored_F.expect &&
47 test_line_count = 8 all_F.expect &&
48 test_line_count = 5 colored_F.expect &&
50 grep "(H" actual > all_H.expect &&
51 grep "<BOLD;BLACK>(H" actual > colored_H.expect &&
52 test_line_count = 5 all_H.expect &&
53 test_line_count = 3 colored_H.expect