This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
forked from nus-cs2103-AY2122S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Bug - Fix PED issues #191
Merged
lchokhoe
merged 4 commits into
AY2122S2-CS2103T-T11-3:master
from
joszx:branch-fix-PED-bugs
Apr 8, 2022
Merged
Bug - Fix PED issues #191
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,18 +51,19 @@ public void isValidEmail() { | |
assertFalse(Email.isValidEmail("[email protected]")); // domain name starts with a hyphen | ||
assertFalse(Email.isValidEmail("[email protected]")); // domain name ends with a hyphen | ||
assertFalse(Email.isValidEmail("[email protected]")); // top level domain has less than two chars | ||
assertFalse(Email.isValidEmail("a@bc")); // minimal, no top level domain | ||
|
||
// valid email | ||
assertTrue(Email.isValidEmail("[email protected]")); // underscore in local part | ||
assertTrue(Email.isValidEmail("[email protected]")); // period in local part | ||
assertTrue(Email.isValidEmail("[email protected]")); // '+' symbol in local part | ||
assertTrue(Email.isValidEmail("[email protected]")); // hyphen in local part | ||
assertTrue(Email.isValidEmail("a@bc")); // minimal | ||
assertTrue(Email.isValidEmail("test@localhost")); // alphabets only | ||
assertTrue(Email.isValidEmail("123@145")); // numeric local part and domain name | ||
assertTrue(Email.isValidEmail("[email protected]")); // alphabets only | ||
assertTrue(Email.isValidEmail("[email protected]")); // numeric local part and domain name | ||
assertTrue(Email.isValidEmail("[email protected]")); // mixture of alphanumeric and special characters | ||
assertTrue(Email.isValidEmail("[email protected]")); // long domain name | ||
assertTrue(Email.isValidEmail("[email protected]")); // long local part | ||
assertTrue(Email.isValidEmail("[email protected]")); // more than one period in domain | ||
assertTrue(Email.isValidEmail("[email protected]")); // more than one domain | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nice regex checking!
This might be useful too: https://stackoverflow.com/questions/624581/what-is-the-best-java-email-address-validation-method, but as mentioned in the comments of the first post there might be some edge cases as well
Other than the suggestion, LGTM!