aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorblafoo <github@blafoo.de>2012-02-12 09:25:36 +0100
committerblafoo <github@blafoo.de>2012-02-12 09:25:36 +0100
commit27cb6c53dbfb77f874c70f3804c1f1a9c2207cb0 (patch)
tree1a8601dd1e6df0e124dadd97d079586e194ebf73 /tests
parentfdbb52ced77f0e2a9273ee5b9efb2796e22ceb48 (diff)
downloadcgeo-27cb6c53dbfb77f874c70f3804c1f1a9c2207cb0.zip
cgeo-27cb6c53dbfb77f874c70f3804c1f1a9c2207cb0.tar.gz
cgeo-27cb6c53dbfb77f874c70f3804c1f1a9c2207cb0.tar.bz2
Parse caches found correctly. Fixes #1107
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/GCConstantsTest.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/GCConstantsTest.java b/tests/src/cgeo/geocaching/GCConstantsTest.java
index be7b5a8..696273d 100644
--- a/tests/src/cgeo/geocaching/GCConstantsTest.java
+++ b/tests/src/cgeo/geocaching/GCConstantsTest.java
@@ -20,9 +20,10 @@ public class GCConstantsTest extends AndroidTestCase {
public static void testCacheCount() {
assertCacheCount(149, "<strong><img src=\"/images/icons/icon_smile.png\" title=\"Caches Found\" /> 149</strong>");
assertCacheCount(491, MockedCache.readCachePage("GC2CJPF"));
+ assertCacheCount(1510, "<strong><img src=\"/images/icons/icon_smile.png\" title=\"Caches Found\" /> 1,510&nbsp;&middot;&nbsp;<img src=\"/images/challenges/types/sm/challenge.png\" title=\"Challenges Completed\" /> 2</strong>");
}
private static void assertCacheCount(final int count, final String html) {
- assertEquals(count, Integer.valueOf(BaseUtils.getMatch(html, GCConstants.PATTERN_CACHES_FOUND, true, "0")).intValue());
+ assertEquals(count, Integer.parseInt(BaseUtils.getMatch(html, GCConstants.PATTERN_CACHES_FOUND, true, "0").replaceAll(",", "")));
}
}