Skip to content

Commit

Permalink
Fix phone number constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxunn committed Nov 7, 2023
1 parent 777eab8 commit 873cbe5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/java/seedu/address/model/person/PhoneTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public void isValidPhone() {
assertFalse(Phone.isValidPhone("phone")); // non-numeric
assertFalse(Phone.isValidPhone("9011p041")); // alphabets within digits
assertFalse(Phone.isValidPhone("9312 1534")); // spaces within digits
assertFalse(Phone.isValidPhone("124293842033123")); // long phone numbers

// valid phone numbers
assertTrue(Phone.isValidPhone("911")); // exactly 3 numbers
assertTrue(Phone.isValidPhone("93121534"));
assertTrue(Phone.isValidPhone("124293842033123")); // long phone numbers
assertTrue(Phone.isValidPhone("911234")); // more than 3 less than 8
}

@Test
Expand Down

0 comments on commit 873cbe5

Please sign in to comment.