Skip to content

Commit

Permalink
Override toString for epsilon and wildcard matchers for better error …
Browse files Browse the repository at this point in the history
…messages
  • Loading branch information
paulbutcher committed May 10, 2011
1 parent cbd03bf commit 52c19d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/MatchAny.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ class MatchAny extends Equals {
override def canEqual(that: Any) = true

override def equals(that: Any) = true

override def toString = "*"
}
2 changes: 2 additions & 0 deletions src/main/scala/MatchEpsilon.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class MatchEpsilon(value: Double) extends Equals {
case n: Number => abs(value - n.doubleValue) < MatchEpsilon.epsilon
case _ => false
}

override def toString = "~"+ value
}

object MatchEpsilon {
Expand Down

0 comments on commit 52c19d0

Please sign in to comment.