mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +01:00 
			
		
		
		
	Fix matching of non-lowercase filename tags
The bug was caused by forgetting to lower-case the filename tag for matching against test spec. Fixes #2064
This commit is contained in:
		@@ -190,6 +190,9 @@ namespace Catch {
 | 
			
		||||
        std::string combined("#");
 | 
			
		||||
        combined += extractFilenamePart(lineInfo.file);
 | 
			
		||||
        internalAppendTag(combined);
 | 
			
		||||
        // TBD: Running this over all tags again is inefficient, but
 | 
			
		||||
        //      simple enough. In practice, the overhead is small enough.
 | 
			
		||||
        toLowerInPlace(backingLCaseTags);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    std::string TestCaseInfo::tagsAsString() const {
 | 
			
		||||
 
 | 
			
		||||
@@ -181,6 +181,10 @@ set_tests_properties(LibIdentityTest PROPERTIES PASS_REGULAR_EXPRESSION "descrip
 | 
			
		||||
add_test(NAME FilenameAsTagsTest COMMAND $<TARGET_FILE:SelfTest> -\# --list-tags)
 | 
			
		||||
set_tests_properties(FilenameAsTagsTest PROPERTIES PASS_REGULAR_EXPRESSION "\\[#Approx.tests\\]")
 | 
			
		||||
 | 
			
		||||
# 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\\]")
 | 
			
		||||
 | 
			
		||||
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")
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user