From 1df71d31e20afff89d844737d140ec6426b98e1c Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Mon, 27 Jun 2022 17:27:27 +0200 Subject: [PATCH] Small improvements in tests --- .../im/vector/app/features/location/LocationDataTest.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vector/src/test/java/im/vector/app/features/location/LocationDataTest.kt b/vector/src/test/java/im/vector/app/features/location/LocationDataTest.kt index d3a1e79922..a0d5b0c3f3 100644 --- a/vector/src/test/java/im/vector/app/features/location/LocationDataTest.kt +++ b/vector/src/test/java/im/vector/app/features/location/LocationDataTest.kt @@ -32,6 +32,10 @@ class LocationDataTest { LocationData(latitude = 12.34, longitude = 56.78, uncertainty = 13.56) parseGeo("geo:12.34,56.78") shouldBeEqualTo LocationData(latitude = 12.34, longitude = 56.78, uncertainty = null) + } + + @Test + fun lenientCases() { // Error is ignored in case of invalid uncertainty parseGeo("geo:12.34,56.78;u=13.5z6") shouldBeEqualTo LocationData(latitude = 12.34, longitude = 56.78, uncertainty = null) @@ -80,7 +84,7 @@ class LocationDataTest { @Test fun unstablePrefixTest() { - val geoUri = "geo :12.34,56.78;u=13.56" + val geoUri = "aGeoUri" val contentWithUnstablePrefixes = MessageLocationContent(body = "", geoUri = "", unstableLocationInfo = LocationInfo(geoUri = geoUri)) contentWithUnstablePrefixes.getBestLocationInfo()?.geoUri.shouldBeEqualTo(geoUri)