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
Fixed trim() for single char strings (github #75)
- Commit
af8d0b3955f21d37adf996516c39a72f400df3b3- Author
- Phil Nash ·
- Parents
97668c76f199
Changes
.gitignore | 3 ++- include/internal/catch_console_colour_impl.hpp | 2 +- include/internal/catch_interfaces_reporter.h | 2 +- projects/SelfTest/MiscTests.cpp | 6 ++++++ .../Phil.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist | 16 ++++++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 835e80a5..e896f281 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ Release *.xcuserstate .DS_Store xcuserdata -CatchSelfTest.xcscheme \ No newline at end of file +CatchSelfTest.xcscheme +Breakpoints.xcbkptlist \ No newline at end of file diff --git a/include/internal/catch_console_colour_impl.hpp b/include/internal/catch_console_colour_impl.hpp index d1d49f34..caad4078 100644 --- a/include/internal/catch_console_colour_impl.hpp +++ b/include/internal/catch_console_colour_impl.hpp @@ -16,7 +16,7 @@ #ifdef CATCH_PLATFORM_WINDOWS -#include "windows.h" +#include <windows.h> namespace Catch { diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index baa16755..f7690d5e 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -136,7 +136,7 @@ namespace Catch std::string::size_type start = str.find_first_not_of( "\n\r\t " ); std::string::size_type end = str.find_last_not_of( "\n\r\t " ); - return start < end ? str.substr( start, 1+end-start ) : ""; + return start != std::string::npos ? str.substr( start, 1+end-start ) : ""; } diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index f73f742d..622a30fb 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -169,3 +169,9 @@ TEST_CASE( "./misc/xmlentitycheck", "" ) // No test } } + +TEST_CASE( "./manual/onechar", "send a single char to INFO" ) +{ + INFO(3); + REQUIRE(false); +} diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/xcuserdata/Phil.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/xcuserdata/Phil.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist index 05301bc2..3cc315ed 100644 --- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/xcuserdata/Phil.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/xcuserdata/Phil.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -2,4 +2,20 @@ <Bucket type = "1" version = "1.0"> + <FileBreakpoints> + <FileBreakpoint + shouldBeEnabled = "Yes" + ignoreCount = "0" + continueAfterRunningActions = "No" + isPathRelative = "0" + filePath = "/Users/Phil/Dev/TwoBlueCubes/Dev/GitHub/CatchBugFix/include/internal/catch_interfaces_reporter.h" + timestampString = "352151729.244063" + startingColumnNumber = "9223372036854775807" + endingColumnNumber = "9223372036854775807" + startingLineNumber = "139" + endingLineNumber = "139" + landmarkName = "trim( const std::string& str )" + landmarkType = "7"> + </FileBreakpoint> + </FileBreakpoints> </Bucket>