Skip to content

Commit

Permalink
Minor fixes in test. The equals method always returned true.
Browse files Browse the repository at this point in the history
This commit ensures that the classes we use to test HashMaps and
HashSets in t6196 and t6200 have proper equals and hashCode
methods. (The old equals method returned always true and therefore
hashCode violated its contract).
  • Loading branch information
gzm0 committed Mar 13, 2014
1 parent 9c38e86 commit 4b0b673
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/files/run/t6196.scala
Expand Up @@ -43,7 +43,7 @@ object Test extends App {

override def equals(that:Any) = {
equalsCount += 1
this match {
that match {
case HashCounter(value) => this.value == value
case _ => false
}
Expand Down
2 changes: 1 addition & 1 deletion test/files/run/t6200.scala
Expand Up @@ -43,7 +43,7 @@ object Test extends App {

override def equals(that: Any) = {
equalsCount += 1
this match {
that match {
case HashCounter(value) => this.value == value
case _ => false
}
Expand Down

0 comments on commit 4b0b673

Please sign in to comment.