You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-android/test/unitTest/java/org/thoughtcrime/securesms/linkpreview/LinkPreviewUtilTest.java

25 lines
580 B
Java

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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