-
Notifications
You must be signed in to change notification settings - Fork 97
refactor: Enforce arrayRef regex & Handling and XML Spacing Rules #3900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
MelReyCG
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a few more work on unit tests
| std::make_tuple( "1e2.3 ", 0, true ), | ||
| std::make_tuple( "1 ", 0, true ), | ||
| std::make_tuple( "1e", 0, true ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing that case instead of adding one to test your new feature? (space before)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the regex has been updated this case no longer works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since your last commit, it is not prohibed nor accepted.
Take clear decision on "1 " and " 1".
| std::make_tuple( "1e2.3 ", 0, true ), | ||
| std::make_tuple( "1 ", 0, true ), | ||
| std::make_tuple( "1e", 0, true ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since your last commit, it is not prohibed nor accepted.
Take clear decision on "1 " and " 1".
| string_view stringTrimed = stringutilities::trimSpaces( value ); | ||
| validateString( string( stringTrimed ), regex ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're getting issues in your unit tests because of the ordering of your validations:
| string_view stringTrimed = stringutilities::trimSpaces( value ); | |
| validateString( string( stringTrimed ), regex ); | |
| validateString( value, regex ); | |
| string_view stringTrimed = stringutilities::trimSpaces( value ); |
| GroupNameTest( groupNameRefArrayRegex, "{path/to/resource*}" ), | ||
| GroupNameTest( groupNameRefArrayRegex, "{[arrayElement]}" ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add these ones in non-array groupName test please?
| GroupNameTest( groupNameRefArrayRegex, "{element with space, another}" ), | ||
| GroupNameTest( groupNameRefArrayRegex, "{element, element with space, 123.456, a-b}" ), | ||
| GroupNameTest( groupNameRefArrayRegex, "{ space at ends } " ), | ||
| GroupNameTest( groupNameRefArrayRegex, "{valuewith,,commas }" ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one with all alowed whitespaces kind in-between the commas ({hello, \t\n\r ,world})
| std::string groupNameComp; | ||
| std::istringstream ss( input.m_valueToTest ); | ||
| ss >> groupNameComp >> std::ws; | ||
| EXPECT_STREQ( groupNameComp.c_str(), groupName.c_str() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert
To reference an array of groups aka
groupNameRefArray, we ensure we have to writeattribute="{*}".We cannot longer write for example :
attribute="*"Also allow to have spaces spaces before and after a value in an attribute :