Bug 1893120 - Partially run StringTest on SDK 28. r=android-reviewers,boek

With Robolectric in tests InetAddresses.isNumericAddress returns false positives.
On android devices it does return correct boolean value.

Differential Revision: https://phabricator.services.mozilla.com/D209644
This commit is contained in:
mcarare 2024-05-14 13:00:49 +00:00
parent d9f83a8108
commit aa1b6948c8

View file

@ -17,6 +17,7 @@ import org.junit.Assert.assertTrue
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.annotation.Config
import java.util.Calendar
import java.util.Calendar.MILLISECOND
@ -468,12 +469,14 @@ class StringTest {
}
@Test
@Config(sdk = [28])
fun `should not strip out www if not first subdomain`() {
"http://foo.www.com" shortenedShouldBecome "foo.www.com"
"http://www.foo.www.com" shortenedShouldBecome "foo.www.com"
}
@Test
@Config(sdk = [28])
fun `should convert to lowercase`() {
"HTTP://FOO.COM" shortenedShouldBecome "foo.com"
}
@ -494,6 +497,7 @@ class StringTest {
}
@Test
@Config(sdk = [28])
fun `should return etld for www gov uk (www-only non-etld)`() {
"https://www.gov.uk/countersigning" shortenedShouldBecome "gov.uk"
}