Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Tighten the test for matching filenames-as-tags

Commit
7b9bf633be13274ada5bb896367fcf63796e5ef9
Author
Martin Hořeňovský ·
Parents
4c8454b5ecfc

Files · Download .tar.gz

Changes

 tests/CMakeLists.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 6d6a00c8..a7651a03 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -209,7 +209,12 @@ set_tests_properties(FilenameAsTagsTest PROPERTIES PASS_REGULAR_EXPRESSION "\\[#
 
 # Check that the filename tags can also be matched against (#2064)
 add_test(NAME FilenameAsTagsMatching COMMAND $<TARGET_FILE:SelfTest> -\# --list-tags [\#Approx.tests])
-set_tests_properties(FilenameAsTagsMatching PROPERTIES PASS_REGULAR_EXPRESSION "\\[#Approx.tests\\]")
+set_tests_properties(FilenameAsTagsMatching
+  PROPERTIES
+    PASS_REGULAR_EXPRESSION "\\[#Approx.tests\\]"
+    # Avoids false positives by looking for start of line (newline) before the 0
+    FAIL_REGULAR_EXPRESSION "[\r\n]0 tag"
+)
 
 add_test(NAME EscapeSpecialCharactersInTestNames COMMAND $<TARGET_FILE:SelfTest> "Test with special\\, characters \"in name")
 set_tests_properties(EscapeSpecialCharactersInTestNames PROPERTIES PASS_REGULAR_EXPRESSION "1 assertion in 1 test case")