mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Use StringRef for CasedString::caseSensitivitySuffix return type
This commit is contained in:
parent
f16be402f7
commit
2e480b6e56
@ -21,10 +21,10 @@ namespace Matchers {
|
|||||||
? toLower( str )
|
? toLower( str )
|
||||||
: str;
|
: str;
|
||||||
}
|
}
|
||||||
std::string CasedString::caseSensitivitySuffix() const {
|
StringRef CasedString::caseSensitivitySuffix() const {
|
||||||
return m_caseSensitivity == CaseSensitive::No
|
return m_caseSensitivity == CaseSensitive::Yes
|
||||||
? " (case insensitive)"
|
? StringRef()
|
||||||
: std::string();
|
: " (case insensitive)"_sr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <catch2/matchers/catch_matchers.hpp>
|
#include <catch2/matchers/catch_matchers.hpp>
|
||||||
#include <catch2/internal/catch_case_sensitive.hpp>
|
#include <catch2/internal/catch_case_sensitive.hpp>
|
||||||
|
#include <catch2/internal/catch_stringref.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ namespace Matchers {
|
|||||||
struct CasedString {
|
struct CasedString {
|
||||||
CasedString( std::string const& str, CaseSensitive caseSensitivity );
|
CasedString( std::string const& str, CaseSensitive caseSensitivity );
|
||||||
std::string adjustString( std::string const& str ) const;
|
std::string adjustString( std::string const& str ) const;
|
||||||
std::string caseSensitivitySuffix() const;
|
StringRef caseSensitivitySuffix() const;
|
||||||
|
|
||||||
CaseSensitive m_caseSensitivity;
|
CaseSensitive m_caseSensitivity;
|
||||||
std::string m_str;
|
std::string m_str;
|
||||||
|
Loading…
Reference in New Issue
Block a user