aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scalding/src/test/scala/sandcrawler/GrobidScorableTest.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/scalding/src/test/scala/sandcrawler/GrobidScorableTest.scala b/scalding/src/test/scala/sandcrawler/GrobidScorableTest.scala
index 620998e..6c45cc5 100644
--- a/scalding/src/test/scala/sandcrawler/GrobidScorableTest.scala
+++ b/scalding/src/test/scala/sandcrawler/GrobidScorableTest.scala
@@ -58,6 +58,7 @@ class GrobidScorableTest extends FlatSpec with Matchers {
}
"""
val GrobidStringWithGoodTitle = GrobidString.replace("<<TITLE>>", "Dummy Example File")
+ val GrobidStringWithMaximumTitle = GrobidString.replace("<<TITLE>>", "T" * Scorable.MaxTitleLength)
val GrobidStringWithExcessiveTitle = GrobidString.replace("<<TITLE>>", "T" * Scorable.MaxTitleLength + "0")
val GrobidStringWithNullTitle = GrobidString.replace("\"<<TITLE>>\"", "null")
val GrobidStringWithoutTitle = GrobidString.replace("title", "nottitle")
@@ -97,6 +98,10 @@ class GrobidScorableTest extends FlatSpec with Matchers {
GrobidScorable.keepRecord(GrobidStringWithGoodTitle) shouldBe true
}
+ it should "return true for valid JSON with a title of maximum permitted length" in {
+ GrobidScorable.keepRecord(GrobidStringWithMaximumTitle) shouldBe true
+ }
+
it should "return false for valid JSON with excessively long title" in {
GrobidScorable.keepRecord(GrobidStringWithExcessiveTitle) shouldBe false
}