[PATCH] test: reset known_broken status in test_expect_equal and test_expect_equal_file

david at tethera.net david at tethera.net
Sun Sep 11 16:11:54 PDT 2011


From: David Bremner <bremner at debian.org>

Commit 4cc6727 introduced the library function
test_subtest_known_broken which sets a variable
test_subtest_known_broken_ . Unfortunately this variable is not reset
if test_begin_subtest is not called before the next
test_expect_success or test_expect_failure.

This commit remedies that, under the assumption that exactly one
test_expect_equal or test_expect_equal_file will follow a
test_begin_subtest
---

Any comments on this? I didn't follow a lot of the original
discussions on the test API very closely. Mainly I want to know if the 
assumption at the end of the commit message seems reasonable.

 test/test-lib.sh |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 196ef49..3c2768c 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -460,6 +460,7 @@ test_expect_equal ()
 			test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
 		fi
     fi
+       test_subtest_known_broken_=
 }
 
 test_expect_equal_file ()
@@ -483,6 +484,7 @@ test_expect_equal_file ()
 			test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
 		fi
     fi
+	test_subtest_known_broken_=
 }
 
 NOTMUCH_NEW ()
-- 
1.7.5.4



More information about the notmuch mailing list