Commit b3a9b362 authored by Marcin Siodelski's avatar Marcin Siodelski

[2313] Trivial: updates to some comments as a result of the second review.

parent f8ad67f7
......@@ -34,14 +34,14 @@ OptionSpace::validateName(const std::string& name) {
using namespace boost::algorithm;
// Allowed characters are: lower or upper case letters, digits,
// underscores and dashes. Empty option spaces are not allowed.
// underscores and hyphens. Empty option spaces are not allowed.
if (all(name, boost::is_from_range('a', 'z') ||
boost::is_from_range('A', 'Z') ||
boost::is_digit() ||
boost::is_any_of("-_")) &&
!name.empty() &&
// Hyphens are not allowed at the beginning and at
// the end of the option space name.
// Hyphens and underscores are not allowed at the beginning
// and at the end of the option space name.
!all(find_head(name, 1), boost::is_any_of("-_")) &&
!all(find_tail(name, 1), boost::is_any_of("-_"))) {
return (true);
......
......@@ -77,8 +77,8 @@ TEST(OptionSpaceTest, validateName) {
EXPECT_FALSE(OptionSpace::validateName(" isc"));
EXPECT_FALSE(OptionSpace::validateName("isc with-space"));
// Hyphens are not allowed at the beginning and at the end
// of the option space name.
// Hyphens and underscores are not allowed at the beginning
// and at the end of the option space name.
EXPECT_FALSE(OptionSpace::validateName("-isc"));
EXPECT_FALSE(OptionSpace::validateName("isc-"));
EXPECT_FALSE(OptionSpace::validateName("_isc"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment