philip1304 / pe

0 stars 0 forks source link

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

Open philip1304 opened 1 week ago

philip1304 commented 1 week ago

When adding a meal entry using the add mealEntry command and including a / in the input, the program will ignore everything between the first / and the /c input.

Screenshot 2024-11-15 at 4.40.04 PM.png

Steps to reproduce:

  1. Add a meal entry with the add mealEntry command. E.g., add mealEntry grapes w/ juice /c200
  2. The program will add the meal entry, but ignore everything between the first / and the /c1
  3. The program will save the meal entry as grapes w with 200 calories

Screenshot 2024-11-15 at 4.41.00 PM.png

nus-pe-bot commented 6 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

Thank you for spotting the error. A clarification that '/' is not allowed within the meal name should have been included with the documentation.

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]