summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorreger <reger18@arcor.de>2015-03-16 02:03:40 +0100
committerreger <reger18@arcor.de>2015-03-16 02:03:40 +0100
commitf63fff90085fc5ff144deb54891c69d5ef5bf146 (patch)
tree1bd96beda9dea0ffa888a2499166b1985584639a /test/net
parentb2412646324a5c74503171246a0b4042e59ff432 (diff)
fix snippet containig number with comma as desmo point http://mantis.tokeek.de/view.php?id=344
to keep it as one word (by altering the split regex) - added sniipet test case with number - regex for word split to match multiple splitcars
Diffstat (limited to 'test/net')
-rw-r--r--test/net/yacy/search/snippet/TextSnippetTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/net/yacy/search/snippet/TextSnippetTest.java b/test/net/yacy/search/snippet/TextSnippetTest.java
index bd92903c6..a038b08fb 100644
--- a/test/net/yacy/search/snippet/TextSnippetTest.java
+++ b/test/net/yacy/search/snippet/TextSnippetTest.java
@@ -152,5 +152,17 @@ public class TextSnippetTest {
System.out.println("testDescriptionline: snippet=" + sniptxt);
assertFalse ("HTML code not allowed in snippet text",sniptxt.contains("<pre>")); // display text not to include unwanted html
assertTrue ("Query word not marked", sniptxt.contains("<b>test</b>")); // query word to be marked
+
+ // test text with some numbers (english/german format)
+ rawtestline = "Test Version 1.83 calculates pi to 3,14 always";
+ ts = new TextSnippet(
+ url.hash(),
+ rawtestline,
+ false, // isMarked,
+ TextSnippet.ResultClass.SOURCE_METADATA, "");
+ sniptxt = ts.descriptionline(qg);
+ System.out.println("testDescriptionline: (with numbers) snippet="+sniptxt);
+ assertTrue ("number (.) broken up",sniptxt.contains("1.83"));
+ assertTrue ("number (,) broken up",sniptxt.contains("3,14"));
}
}