session-android/test/unitTest/java/org/thoughtcrime/securesms/linkpreview/LinkPreviewUtilTest.java

25 lines
580 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"));
}
}