philip1304 / pe

0 stars 0 forks source link

When adding a meal menu with '/' in the name, it ignores everything between the '/' and the calorie input. #3

Open philip1304 opened 1 week ago

philip1304 commented 1 week ago

When adding a meal that contains a '/' in the name, it ignores everything in between the '/' and the '/c'.

Screenshot 2024-11-15 at 4.29.42 PM.png

Steps to reproduce:

  1. Add a new meal via the save meal command. E.g., save meal beef stew w/potatoes and carrots /c750
  2. Input meal menu. You will see that the program has saved the meal as beef stew w with 750 calories

Screenshot 2024-11-15 at 4.34.19 PM.png

nus-pe-bot commented 5 days ago

[IMPORTANT!: Please do not edit or reply to this comment using the GitHub UI. You can respond to it using CATcher during the next phase of the PE]

Team's Response

Duplicate of issue #269 as same parser is being used across both commands.

The 'Original' Bug

[The team marked this bug as a duplicate of the following bug]

"save meal" does not handle special characters in string

I suppose that the meal menu should only contain upper case or lower case alphabetical characters from "a" to "z". A wrong string format exception should be thrown And the string after "/" in the meal string is not handled in this case

save meal mat-cha /c800
     _____________________________________________________________________________
     Added to options: mat-cha with 800 calories
     _____________________________________________________________________________
save meal hot/dog /c1000
     _____________________________________________________________________________
     Added to options: hot with 1000 calories
     _____________________________________________________________________________

[original: nus-cs2113-AY2425S1/pe-interim#152] [original labels: severity.Medium type.FunctionalityBug]

Their Response to the 'Original' Bug

[This is the team's response to the above 'original' bug]

Thank you for spotting the bug. We should have specified a constraint on meal names not having '/' inside of them. However, as this bug does not cause the programme to break, and is a rare occurrence, we have thus reclassified it to 'low'.

Items for the Tester to Verify

:question: Issue duplicate status

Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)

Reason for disagreement: [replace this with your reason]


## :question: Issue severity Team chose [`severity.Low`] Originally [`severity.Medium`] - [ ] I disagree **Reason for disagreement:** [replace this with your reason]