t9300 (fast-import): style tweaks
commit5f3ed2aba6de4865ab14e9392efc1621ed4df4b0
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 5 Sep 2010 03:22:53 +0000 (4 22:22 -0500)
committerDavid Barr <david.barr@cordelta.com>
Fri, 10 Sep 2010 04:26:22 +0000 (10 14:26 +1000)
treef5ed1a1112e2ba624737ca252e5c671fc6a17230
parent8ac8cf5bc17ef11a9c5d51ab128ad010cb37c464
t9300 (fast-import): style tweaks

Clarify dependencies between tests to make the fast-import test
script more approachable.  In particular:

 - guard setup commands with test assertions (for robustness and to
   make it easier to identify where each test starts and ends);

 - mention "setup" in the descriptions of tests that are used to
   prepare for later ones;

 - avoid hard-coded object names.  Although compare_diff_raw means
   most of them do not affect the test result, the reader can
   benefit more from other object descriptions;

 - tweak whitespace style: each test now starts with a test assertion,
   description, and opening quote on a single line, followed by test
   code that checks a single claim;

While at it:

 - introduce a verify_packs() helper, avoiding some repetition;

 - use test_cmp instead of test $foo = $bar for nicer output with -v;

 - use multiple separate commands instead of pipelines when that
   helps debugability;

 - use $(...) command substitutions in preference to ``; the former
   are less error-prone with respect to quoting and easier to notice
   when looking for $variable interpolations.

 - do not let tests exit the entire test script when they fail.

Cc: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
t/t9300-fast-import.sh