Skip to content
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

Enhance arg multimap #192

Conversation

bryanwee023
Copy link

Fixes #191 .

ArgumentTokenizer should attempt to detect all possible prefixes. If it detects a prefix that is not in its list of expected prefixes, it will throw an appropriate ParseException.

Misc Edits:

  • Move @wangpeialex's equivalence partition tests from AddToOrderCommandParserTest to ParserUtilTest, where it is more appropriate.

@bryanwee023 bryanwee023 added this to the v1.4 milestone Nov 5, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #192 (581e890) into master (267a041) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #192      +/-   ##
============================================
+ Coverage     71.44%   71.50%   +0.06%     
+ Complexity      739      736       -3     
============================================
  Files            99       99              
  Lines          2150     2141       -9     
  Branches        298      296       -2     
============================================
- Hits           1536     1531       -5     
+ Misses          497      496       -1     
+ Partials        117      114       -3     
Impacted Files Coverage Δ
...main/java/seedu/address/commons/core/Messages.java 0.00% <ø> (ø)
...eedu/address/logic/parser/RemoveCommandParser.java 70.00% <ø> (+6.36%) ⬆️
.../address/logic/parser/AddToOrderCommandParser.java 70.00% <100.00%> (-2.73%) ⬇️
.../seedu/address/logic/parser/ArgumentTokenizer.java 96.96% <100.00%> (-0.40%) ⬇️
.../seedu/address/logic/parser/FindCommandParser.java 90.47% <100.00%> (ø)
.../seedu/address/logic/parser/SortCommandParser.java 100.00% <0.00%> (+11.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 267a041...581e890. Read the comment docs.

Copy link

@bernarduskrishna bernarduskrishna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Very thorough work.

Comment on lines +55 to +75
/* Equivalence Partitions:
Expected Prefixes:
- No prefixes
- Single character prefixes
- Multiple character prefixes
- Prefixes not in arg string

Preamble:
- Empty string
- Single word
- Multiple word

Parameters:
- Empty parameter
- Single word
- Multiple word
- Single word with trailing / leading spaces
- Multiple word with trailing / leading spaces

The following test cases attempts to cover all partitions in an efficient manner.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup LGTM. Nice that you put the equivalence partitions as well.

@bernarduskrishna bernarduskrishna merged commit 9ceaf0a into AY2122S1-CS2103-F10-2:master Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extraneous prefixes are recognised as parameters in command parsing
3 participants