summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20873f4)
raw | patch | inline | side by side (parent: 20873f4)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Jul 2010 18:37:30 +0000 (11:37 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Jul 2010 18:37:30 +0000 (11:37 -0700) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/README | patch | blob | history |
diff --git a/t/README b/t/README
index e4816572f2da40a57e4e32648857d34ed9d64965..271f8684e959ca01e9f5bb2163f31eaae5733e2a 100644 (file)
--- a/t/README
+++ b/t/README
Do's, don'ts & things to keep in mind
-------------------------------------
-Here's a few examples of things you probably should and shouldn't do
+Here are a few examples of things you probably should and shouldn't do
when writing tests.
Do:
- - Put as much code as possible inside test_expect_success and other
- assertions.
+ - Put all code inside test_expect_success and other assertions.
Even code that isn't a test per se, but merely some setup code
- should be inside a test assertion if at all possible. Test scripts
- should only have trivial code outside of their assertions.
+ should be inside a test assertion.
- Chain your test assertions
- Break the TAP output
- The raw output from your test might be interpreted by a TAP
- harness. You usually don't have to worry about that. TAP harnesses
- will ignore everything they don't know about, but don't step on
- their toes in these areas:
+ The raw output from your test may be interpreted by a TAP harness. TAP
+ harnesses will ignore everything they don't know about, but don't step
+ on their toes in these areas:
- Don't print lines like "$x..$y" where $x and $y are integers.
- Don't print lines that begin with "ok" or "not ok".
- A TAP harness expect a line that begins with either "ok" and "not
+ TAP harnesses expect a line that begins with either "ok" and "not
ok" to signal a test passed or failed (and our harness already
produces such lines), so your script shouldn't emit such lines to
their output.
Keep in mind:
- - That what you print to stderr and stdout is usually ignored
-
- Inside <script> part, the standard output and standard error
+ - Inside <script> part, the standard output and standard error
streams are discarded, and the test harness only reports "ok" or
"not ok" to the end user running the tests. Under --verbose, they
are shown to help debugging the tests.