t3206: add color test for range-diff --dual-color

The 'expect'ed outcome has been taken by running the 'range-diff | decode'. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Aug 13, 2018 at 18:41 UTC c5e64caaa9c45988b474765182a508f305f05e6b
1 file changed +39
t/t3206-range-diff.sh
+39
@@ -142,4 +142,43 @@ test_expect_success 'changed message' '
142 test_cmp expected actual
143 '
144
145 +test_expect_success 'dual-coloring' '
146 + sed -e "s|^:||" >expect <<-\EOF &&
147 + :<YELLOW>1: a4b3333 = 1: f686024 s/5/A/<RESET>
148 + :<RED>2: f51d370 <RESET><YELLOW>!<RESET><GREEN> 2: 4ab067d<RESET><YELLOW> s/4/A/<RESET>
149 + : <REVERSE><CYAN>@@ -2,6 +2,8 @@<RESET>
150 + : <RESET>
151 + : s/4/A/<RESET>
152 + : <RESET>
153 + : <REVERSE><GREEN>+<RESET><BOLD> Also a silly comment here!<RESET>
154 + : <REVERSE><GREEN>+<RESET><BOLD><RESET>
155 + : diff --git a/file b/file<RESET>
156 + : <RED> --- a/file<RESET>
157 + : <GREEN> +++ b/file<RESET>
158 + :<RED>3: 0559556 <RESET><YELLOW>!<RESET><GREEN> 3: b9cb956<RESET><YELLOW> s/11/B/<RESET>
159 + : <REVERSE><CYAN>@@ -10,7 +10,7 @@<RESET>
160 + : 9<RESET>
161 + : 10<RESET>
162 + : <RED> -11<RESET>
163 + : <REVERSE><RED>-<RESET><FAINT;GREEN>+BB<RESET>
164 + : <REVERSE><GREEN>+<RESET><BOLD;GREEN>+B<RESET>
165 + : 12<RESET>
166 + : 13<RESET>
167 + : 14<RESET>
168 + :<RED>4: d966c5c <RESET><YELLOW>!<RESET><GREEN> 4: 8add5f1<RESET><YELLOW> s/12/B/<RESET>
169 + : <REVERSE><CYAN>@@ -8,7 +8,7 @@<RESET>
170 + : <CYAN> @@<RESET>
171 + : 9<RESET>
172 + : 10<RESET>
173 + : <REVERSE><RED>-<RESET><FAINT> BB<RESET>
174 + : <REVERSE><GREEN>+<RESET><BOLD> B<RESET>
175 + : <RED> -12<RESET>
176 + : <GREEN> +B<RESET>
177 + : 13<RESET>
178 + EOF
179 + git range-diff changed...changed-message --color --dual-color >actual.raw &&
180 + test_decode_color >actual <actual.raw &&
181 + test_cmp expect actual
182 +'
183 +
184 test_done