Thread (181 messages) 181 messages, 7 authors, 2021-01-20
STALE1983d

[PATCH 1/6] test-lib: add tests for test_might_fail

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-01-14 23:36:22
Subsystem: the rest · Maintainer: Linus Torvalds

This trivial sibling command of test_must_fail added in
fdf1bc48ca (t7006: guard cleanup with test_expect_success, 2010-04-14)
didn't have any tests. Let's add at least a basic one.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t0000-basic.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index f4ba2e8c85..f90c375fe9 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -1326,4 +1326,10 @@ test_expect_success 'test_must_fail rejects a non-git command with env' '
 	grep -F "test_must_fail: only '"'"'git'"'"' is allowed" err
 '
 
+test_expect_success 'test_might_fail is like test_must_fail ok=' '
+	! test_must_fail git version &&
+	! test_must_fail ok= git version &&
+	test_might_fail git version
+'
+
 test_done
-- 
2.29.2.222.g5d2a92d10f8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help