tests: make use of the test_must_be_empty function
Change various tests that use an idiom of the form: >expect && test_cmp expect actual To instead use: test_must_be_empty actual The test_must_be_empty() wrapper was introduced in ca8d148daf ("test: test_must_be_empty helper", 2013-06-09). Many of these tests have been added after that time. This was mostly found with, and manually pruned from: git grep '^\s+>.*expect.* &&$' t Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Jul 27, 2018 at 17:48 UTC
9f4bcf81eafa72587b2e3ec19690f127bc3ad7c8
2 files changed
+2
-4
t/t2024-checkout-dwim.sh
+1
-2
@@ -24,9 +24,8 @@ test_branch_upstream () {
24
}
25
26
status_uno_is_clean () {
27
- >status.expect &&
27
git status -uno --porcelain >status.actual &&
29
- test_cmp status.expect status.actual
28
+ test_must_be_empty status.actual
29
}
30
31
test_expect_success 'setup' '
t/t2025-worktree-add.sh
+1
-2
@@ -412,9 +412,8 @@ test_expect_success '"add" <path> <branch> dwims with checkout.defaultRemote' '
412
git fetch repo_upstream2 &&
413
test_must_fail git worktree add ../foo foo &&
414
git -c checkout.defaultRemote=repo_upstream worktree add ../foo foo &&
415
- >status.expect &&
415
git status -uno --porcelain >status.actual &&
417
- test_cmp status.expect status.actual
416
+ test_must_be_empty status.actual
417
) &&
418
(
419
cd foo &&