mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 19:29:54 +01:00
Fix phone number format crash.
This commit is contained in:
committed by
Greyson Parrelli
parent
a17fd447a7
commit
8c34357cc6
@@ -3,13 +3,17 @@ package org.thoughtcrime.securesms.phonenumbers;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.testutil.EmptyLogger;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
public class PhoneNumberFormatterTest {
|
||||
|
||||
@Before
|
||||
public void setup() {}
|
||||
public void setup() {
|
||||
Log.initialize(new EmptyLogger());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddressString() throws Exception {
|
||||
@@ -89,4 +93,11 @@ public class PhoneNumberFormatterTest {
|
||||
PhoneNumberFormatter formatter = new PhoneNumberFormatter("US", true);
|
||||
assertEquals(formatter.format("(415) 111-1122"), "+14151111122");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseNumberFailWithoutLocalNumber() {
|
||||
PhoneNumberFormatter formatter = new PhoneNumberFormatter("US", true);
|
||||
assertEquals("+144444444441234512312312312312312312312", formatter.format("44444444441234512312312312312312312312"));
|
||||
assertEquals("+144444444441234512312312312312312312312", formatter.format("144444444441234512312312312312312312312"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user