mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-19 19:17:44 +00:00
Improved handling for URLs that are composed of mixed character sets.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package org.thoughtcrime.securesms.linkpreview;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static junit.framework.TestCase.assertFalse;
|
||||
import static junit.framework.TestCase.assertTrue;
|
||||
|
||||
public class LinkPreviewUtilTest {
|
||||
|
||||
@Test
|
||||
public void isLegal_allLatin() {
|
||||
assertTrue(LinkPreviewUtil.isLegalUrl("https://signal.org"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isLegal_latinAndCyrillic() {
|
||||
assertFalse(LinkPreviewUtil.isLegalUrl("https://www.аmazon.com"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isLegal_latinAndGreek() {
|
||||
assertFalse(LinkPreviewUtil.isLegalUrl("https://www.αpple.com"));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user