From 0aa4dbae2e5d0b86fc6602354fdcea6d186752b2 Mon Sep 17 00:00:00 2001 From: Martin Mekota Date: Thu, 17 Mar 2022 20:56:11 +0100 Subject: [PATCH] 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 --- 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) {