aboutsummaryrefslogtreecommitdiffstats
path: root/scalding/src/test/scala
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2018-08-15 20:22:04 -0700
committerBryan Newbold <bnewbold@archive.org>2018-08-15 20:22:04 -0700
commit419ca3dc053682d688653e9a64eaaf46018fd330 (patch)
treed65a9fbb6d97957269fdcf53ea51e422d1cb6a08 /scalding/src/test/scala
parentdf341a68459829380f1f01015768acee5642f15b (diff)
downloadsandcrawler-419ca3dc053682d688653e9a64eaaf46018fd330.tar.gz
sandcrawler-419ca3dc053682d688653e9a64eaaf46018fd330.zip
scorable: test for null strings
Diffstat (limited to 'scalding/src/test/scala')
-rw-r--r--scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala5
1 files changed, 5 insertions, 0 deletions
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"
}