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

Fix filename as tag bug

When a test file isn't provided with "/" in the path,
the filename isn't registered as a tag.
Fixing by providing a conditon for this edge case.

Closes #2328
Commit
0aa4dbae2e5d0b86fc6602354fdcea6d186752b2
Author
Martin Mekota ·
Committer
Martin Hořeňovský
Parents
ff151d2833d4

Files · Download .tar.gz

Changes

 include/internal/catch_session.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/internal/catch_session.cpp b/include/internal/catch_session.cpp
index 24ebe4de..6254c584 100644
--- a/include/internal/catch_session.cpp
+++ b/include/internal/catch_session.cpp
@@ -127,6 +127,10 @@ namespace Catch {
                     filename.erase(0, lastSlash);
                     filename[0] = '#';
                 }
+                else
+                {
+                    filename.insert(0, "#");
+                }
 
                 auto lastDot = filename.find_last_of('.');
                 if (lastDot != std::string::npos) {