From 419ca3dc053682d688653e9a64eaaf46018fd330 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 15 Aug 2018 20:22:04 -0700 Subject: scorable: test for null strings --- scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scalding/src/test') diff --git a/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala b/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala index f9c30a2..5ffc305 100644 --- a/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala +++ b/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala @@ -8,6 +8,11 @@ class ScorableFeaturesTest extends FlatSpec with Matchers { new ScorableFeatures(title = s).toSlug } + "toMapFeatures()" should "work with gnarly inputs" in { + new ScorableFeatures(title = null).toMapFeatures + new ScorableFeatures(title = "something", doi = null, sha1 = null, year = 123).toMapFeatures + } + "mapToSlug()" should "extract the parts of titles before a colon" in { titleToSlug("HELLO:there") shouldBe "hello" } -- cgit v1.2.3