aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-01-17 20:44:04 +0100
committerBananeweizen <bananeweizen@gmx.de>2013-01-17 20:44:04 +0100
commit37a2d75910512317a8e8a02a0237a5ff04c8d592 (patch)
treec2b0acc8447dac9dbad300a35449370c575c82f5 /tests/src/cgeo
parent821bec6b5e14c0ffd4adf977074c5b84421e99c0 (diff)
downloadcgeo-37a2d75910512317a8e8a02a0237a5ff04c8d592.zip
cgeo-37a2d75910512317a8e8a02a0237a5ff04c8d592.tar.gz
cgeo-37a2d75910512317a8e8a02a0237a5ff04c8d592.tar.bz2
fix #2404: Remove spaces when editing coordinates
Diffstat (limited to 'tests/src/cgeo')
-rw-r--r--tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java b/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java
index 44fbe18..6b70523 100644
--- a/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java
+++ b/tests/src/cgeo/geocaching/geopoint/GeoPointParserTest.java
@@ -28,7 +28,7 @@ public class GeoPointParserTest extends AndroidTestCase {
} catch (Geopoint.ParseException e) {
// expected
}
- assertEquals(null, point);
+ assertNull(point);
}
@@ -55,7 +55,7 @@ public class GeoPointParserTest extends AndroidTestCase {
final Geopoint p2 = GeopointParser.parse("N51 21.523", "E07 02.680");
assertNotNull(p1);
assertNotNull(p2);
- assertTrue(p1.equals(p2));
+ assertEquals(p1, p2);
}
public static void testUnrelatedParts() {
@@ -65,7 +65,7 @@ public class GeoPointParserTest extends AndroidTestCase {
} catch (Geopoint.ParseException e) {
// expected
}
- assertEquals(null, point);
+ assertNull(point);
}
public static void testComma() {
@@ -75,6 +75,15 @@ public class GeoPointParserTest extends AndroidTestCase {
"E 15° 53' 41.68''");
assertNotNull(pointComma);
assertNotNull(pointDot);
- assertTrue(pointComma.equals(pointDot));
+ assertEquals(pointComma, pointDot);
}
+
+ public static void testBlankAddedByAutocorrectionDot() {
+ assertEquals(refLatitude, GeopointParser.parseLatitude("N 49° 56. 031"), 1e-8);
+ }
+
+ public static void testBlankAddedByAutocorrectionComma() {
+ assertEquals(refLatitude, GeopointParser.parseLatitude("N 49° 56, 031"), 1e-8);
+ }
+
}