diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-08-15 20:22:44 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-08-15 20:22:44 -0700 |
commit | a3bf1d47fac53b818a8118020adced6c54be7cba (patch) | |
tree | acfbddbda1f14642a30e1659aca05dbdef14b67a /scalding/src/test/scala | |
parent | 419ca3dc053682d688653e9a64eaaf46018fd330 (diff) | |
download | sandcrawler-a3bf1d47fac53b818a8118020adced6c54be7cba.tar.gz sandcrawler-a3bf1d47fac53b818a8118020adced6c54be7cba.zip |
crossref: test for empty-string title
Diffstat (limited to 'scalding/src/test/scala')
-rw-r--r-- | scalding/src/test/scala/sandcrawler/CrossrefScorableTest.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scalding/src/test/scala/sandcrawler/CrossrefScorableTest.scala b/scalding/src/test/scala/sandcrawler/CrossrefScorableTest.scala index e171dba..1789d1a 100644 --- a/scalding/src/test/scala/sandcrawler/CrossrefScorableTest.scala +++ b/scalding/src/test/scala/sandcrawler/CrossrefScorableTest.scala @@ -67,6 +67,7 @@ class CrossrefScorableTest extends FlatSpec with Matchers { """ // scalastyle:on val CrossrefStringWithTitle = CrossrefString.replace("<<TITLE>>", "Some Title") + val CrossrefStringWithEmptyTitle = CrossrefString.replace("<<TITLE>>", "") val CrossrefStringWithoutTitle = CrossrefString.replace("title", "nottitle") val MalformedCrossrefString = CrossrefString.replace("}", "") @@ -81,6 +82,11 @@ class CrossrefScorableTest extends FlatSpec with Matchers { result.slug shouldBe Scorable.NoSlug } + it should "handle empty title" in { + val result = CrossrefScorable.jsonToMapFeatures(CrossrefStringWithEmptyTitle) + result.slug shouldBe Scorable.NoSlug + } + it should "handle valid input" in { val result = CrossrefScorable.jsonToMapFeatures(CrossrefStringWithTitle) result.slug shouldBe "sometitle" |