mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +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:
parent
0c7f96ba63
commit
8878f90323
@ -190,6 +190,9 @@ namespace Catch {
|
|||||||
std::string combined("#");
|
std::string combined("#");
|
||||||
combined += extractFilenamePart(lineInfo.file);
|
combined += extractFilenamePart(lineInfo.file);
|
||||||
internalAppendTag(combined);
|
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 {
|
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)
|
add_test(NAME FilenameAsTagsTest COMMAND $<TARGET_FILE:SelfTest> -\# --list-tags)
|
||||||
set_tests_properties(FilenameAsTagsTest PROPERTIES PASS_REGULAR_EXPRESSION "\\[#Approx.tests\\]")
|
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")
|
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")
|
set_tests_properties(EscapeSpecialCharactersInTestNames PROPERTIES PASS_REGULAR_EXPRESSION "1 assertion in 1 test case")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user