@@ -161,6 +161,49 @@ command about a connected history. Otherwise, it is a command about
161161discrete point(s).
162162```
163163
164+ * [ War on broken &&-chain] ( http://thread.gmane.org/gmane.comp.version-control.git/265874 ) (* written by Junio C Hamano* )
165+
166+ We often see review comments on test scripts that points out a
167+ breakage in the &&-chain, but what does that mean?
168+
169+ When you have a test that looks like this:
170+
171+ ```
172+ test_expect_success 'frotz and nitfol work' '
173+ git frotz
174+ git nitfol
175+ '
176+ ```
177+
178+ the test framework will not detect even if the ` frotz ` command
179+ exits with a non-zero error status. A test must be written like
180+ this instead:
181+
182+ ```
183+ test_expect_success 'frotz and nitfol work' '
184+ git frotz &&
185+ git nitfol
186+ '
187+ ```
188+
189+ Jeff resurrected a clever idea, which was first floated by Jonathan
190+ Nieder in October 2013, to automate detection of such an issue. The
191+ idea is to try running the test body with this magic string prefixed:
192+ ` (exit 117) && ` . If everything is properly chained together with ` && `
193+ in the test, running such a test will exit with error code 117 (and
194+ the important assumption is that error code is unused elsewhere). If
195+ on the other hand, if there is an breakage, the test prefixed with the
196+ magic string would either succeed or fail with a code different from
197+ 117 . His work caught many real test breakages but fortunately it was
198+ found that no command being tested was failing ;-)
199+
200+ As the variety of platforms each developer has access to and the time
201+ each developer has to test Git on them is inevitably limited, broken
202+ &&-chains in some tests that Jeff didn't run were expected to be
203+ caught by others. Torsten Bögershausen did find one in a test that
204+ runs only on a case insensitive filesystem a few days later.
205+
206+
164207### Support
165208
166209* [ Git with Lader logic] ( http://thread.gmane.org/gmane.comp.version-control.git/265679/ )
0 commit comments