fix tests
parent
f259240f7f
commit
0af50ff160
|
@ -44,11 +44,11 @@ private object Flood {
|
|||
"Bye!"
|
||||
)
|
||||
|
||||
private case class Message(text: String, date: Instant)
|
||||
private[security] case class Message(text: String, date: Instant)
|
||||
|
||||
private type Messages = List[Message]
|
||||
|
||||
private def duplicateMessage(msg: Message, msgs: Messages): Boolean =
|
||||
private[security] def duplicateMessage(msg: Message, msgs: Messages): Boolean =
|
||||
!passList.contains(msg.text) && msgs.headOption.?? { m =>
|
||||
similar(m.text, msg.text) || msgs.tail.headOption.?? { m2 =>
|
||||
similar(m2.text, msg.text)
|
||||
|
|
|
@ -7,12 +7,12 @@ class FloodTest extends Specification {
|
|||
|
||||
import Flood._
|
||||
|
||||
def isDup = duplicateMessage _
|
||||
private def isDup = duplicateMessage _
|
||||
|
||||
def m(s: String) = Message(s, Instant.now)
|
||||
private def m(s: String) = Message(s, Instant.now)
|
||||
|
||||
val str = "Implementation uses dynamic programming (Wagner–Fischer algorithm)"
|
||||
val msg = m(str)
|
||||
private val str = "Implementation uses dynamic programming (Wagner–Fischer algorithm)"
|
||||
private val msg = m(str)
|
||||
|
||||
"find duplicate" should {
|
||||
"same" in {
|
||||
|
|
Loading…
Reference in New Issue