Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c20598be authored by Hall Liu's avatar Hall Liu
Browse files

Add unit test for isEmailAddress

Add a unit test for isEmailAddress, copied from Telephony.Mms

Bug: 146834818
Test: atest GsmSmsTest#testIsEmailAddress
Change-Id: I9475fda33bde65d2f6bbef69501bd92a0d664b39
Merged-In: I9475fda33bde65d2f6bbef69501bd92a0d664b39
parent 4ebd80ee
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -55,6 +55,15 @@ public class GsmSmsTest extends AndroidTestCase {
        assertEquals("+8613693092030", sms.getRecipientAddress());
    }

    @SmallTest
    public void testIsEmailAddress() throws Exception {
        assertTrue(SmsMessage.isEmailAddress("\"First Last\" <name@example.com>"));
        assertTrue(SmsMessage.isEmailAddress("FirstLast <name@sub.example.com>"));
        assertFalse(SmsMessage.isEmailAddress("FirstLast 1112223333"));
        assertFalse(SmsMessage.isEmailAddress(""));
        assertFalse(SmsMessage.isEmailAddress("nmg5gj945j"));
    }

    @SmallTest
    public void testUdh() throws Exception {
        String pdu = "07914140279510F6440A8111110301003BF56080207130138A8C0B05040B8423F"