Fixed trim() for single char strings (github #75)
This commit is contained in:
parent
97668c76f1
commit
af8d0b3955
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,4 +9,5 @@ Release
|
||||
*.xcuserstate
|
||||
.DS_Store
|
||||
xcuserdata
|
||||
CatchSelfTest.xcscheme
|
||||
CatchSelfTest.xcscheme
|
||||
Breakpoints.xcbkptlist
|
@ -16,7 +16,7 @@
|
||||
|
||||
#ifdef CATCH_PLATFORM_WINDOWS
|
||||
|
||||
#include "windows.h"
|
||||
#include <windows.h>
|
||||
|
||||
namespace Catch
|
||||
{
|
||||
|
@ -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 ) : "";
|
||||
}
|
||||
|
||||
|
||||
|
@ -169,3 +169,9 @@ TEST_CASE( "./misc/xmlentitycheck", "" )
|
||||
// No test
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "./manual/onechar", "send a single char to INFO" )
|
||||
{
|
||||
INFO(3);
|
||||
REQUIRE(false);
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user