diff options
author | Ellen Spertus <ellen.spertus@gmail.com> | 2018-08-07 10:22:02 -0700 |
---|---|---|
committer | Ellen Spertus <ellen.spertus@gmail.com> | 2018-08-07 10:22:02 -0700 |
commit | dddb7ed410bdd542ca12756d3e97aca6beea5532 (patch) | |
tree | 669cc1f76f47710bd74ef4ee693f7e52f39e2353 | |
parent | 6cdea0ec0950c8f12c362b6521a1bbbabc3db379 (diff) | |
download | sandcrawler-dddb7ed410bdd542ca12756d3e97aca6beea5532.tar.gz sandcrawler-dddb7ed410bdd542ca12756d3e97aca6beea5532.zip |
Added test, which passes.
-rw-r--r-- | scalding/src/test/scala/sandcrawler/ScorableTest.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scalding/src/test/scala/sandcrawler/ScorableTest.scala b/scalding/src/test/scala/sandcrawler/ScorableTest.scala index 78cd358..535b8f6 100644 --- a/scalding/src/test/scala/sandcrawler/ScorableTest.scala +++ b/scalding/src/test/scala/sandcrawler/ScorableTest.scala @@ -57,13 +57,11 @@ class ScorableTest extends FlatSpec with Matchers { val MalformedJsonString = JsonString.replace("}", "") "titleToSlug()" should "extract the parts of titles before a colon" in { - val slug = Scorable.titleToSlug("HELLO:there") - slug shouldBe "hello" + Scorable.titleToSlug("HELLO:there") shouldBe "hello" } it should "extract an entire colon-less string" in { - val slug = Scorable.titleToSlug("hello THERE") - slug shouldBe "hello there" + Scorable.titleToSlug("hello THERE") shouldBe "hello there" } it should "return Scorable.NoSlug if given empty string" in { @@ -78,7 +76,12 @@ class ScorableTest extends FlatSpec with Matchers { Scorable.jsonToMap("illegal{,json{{") should be (None) } -/* + "computeOutput()" should "return Scorable.MaxScore if given identical ReduceFeatures" in { + val output = Scorable.computeOutput(new ReduceFeatures(JsonString), new ReduceFeatures(JsonString)) + output.score shouldBe Scorable.MaxScore + } + + /* it should "return None if given a malformed json string" in { val slug = Scorable.grobidToSlug(MalformedGrobidString) slug shouldBe None |