diff options
-rw-r--r-- | scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala b/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala index e6211a2..e4cab95 100644 --- a/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala +++ b/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala @@ -126,6 +126,10 @@ class HBaseCrossrefScoreTest extends FlatSpec with Matchers { slug should contain ("hello there") } + it should "return None if given empty string" in { + HBaseCrossrefScore.titleToSlug("") shouldBe None + } + "grobidToSlug()" should "get the right slug for a grobid json string" in { val slug = HBaseCrossrefScore.grobidToSlug(GrobidStringWithTitle) slug should contain ("dummy example file") @@ -141,6 +145,11 @@ class HBaseCrossrefScoreTest extends FlatSpec with Matchers { slug shouldBe None } + it should "return None if given an empty json string" in { + val slug = HBaseCrossrefScore.grobidToSlug("") + slug shouldBe None + } + "crossrefToSlug()" should "get the right slug for a crossref json string" in { val slug = HBaseCrossrefScore.crossrefToSlug(CrossrefStringWithTitle) slug should contain ("sometitle") |