- 
                Notifications
    You must be signed in to change notification settings 
- Fork 179
test: Yahcli tests base enhancement #21034
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: 20994-yahcli-param-unit-tests
Are you sure you want to change the base?
test: Yahcli tests base enhancement #21034
Conversation
Signed-off-by: Zhivko Kelchev <[email protected]>
| 🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) | 
Signed-off-by: ibankov <[email protected]>
| Codecov Report✅ All modified and coverable lines are covered by tests. @@                       Coverage Diff                        @@
##             20994-yahcli-param-unit-tests   #21034   +/-   ##
================================================================
  Coverage                                 ?   71.23%           
  Complexity                               ?    24198           
================================================================
  Files                                    ?     2669           
  Lines                                    ?   103294           
  Branches                                 ?    10750           
================================================================
  Hits                                     ?    73585           
  Misses                                   ?    25669           
  Partials                                 ?     4040           🚀 New features to boost your workflow:
 | 
| Coverage summary from CodacySee diff coverage on Codacy
 Coverage variation details
 Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:  Diff coverage details
 Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:  See your quality gate settings Change summary preferencesFootnotes
 | 
Signed-off-by: Zhivko Kelchev <[email protected]>
Signed-off-by: Zhivko Kelchev <[email protected]>
| } | ||
| } | ||
|  | ||
| // TODO: check if this is needed | 
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 remove
| return commandLine.parseArgs(args.split(" ")); | ||
| List<String> result = new ArrayList<>(); | ||
| // Match and preserve quoted strings while splitting by whitespace outside of quotes | ||
| Pattern pattern = Pattern.compile("\"([^\"\\\\]|\\\\.)*\"|'([^'\\\\]|\\\\.)*'|\\S+"); | 
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.
Nit: we can extract this to a static constant so we don't have to .compile(...) every time, which is relatively expensive
Description:
YahcliTestBase#parseArgs()to support multi-word string values parsingDualPrintStreamso system.out output is not only captured, but logged to the console as well.Related issue(s):
Fixes #
Notes for reviewer:
Checklist