Add additional valid characters to parameter names
I feel as though the alphanumeric + `_` charset is too restrictive, especially when formatting complex objects into names. Added a few extra characters which will help with this.
This commit is contained in:
parent
d854bd6acc
commit
4483e8137a
|
@ -634,6 +634,8 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
|
|||
};
|
||||
typedef ::std::vector<InstantiationInfo> InstantiationContainer;
|
||||
|
||||
static std::string validParamChars = "_-:/";
|
||||
|
||||
static bool IsValidParamName(const std::string& name) {
|
||||
// Check for empty string
|
||||
if (name.empty())
|
||||
|
@ -641,7 +643,7 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
|
|||
|
||||
// Check for invalid characters
|
||||
for (std::string::size_type index = 0; index < name.size(); ++index) {
|
||||
if (!isalnum(name[index]) && name[index] != '_')
|
||||
if (!isalnum(name[index]) && validParamChars.find(name[index]) == std::string::npos)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user