From 4b0b673c7d1e7ee9c979680ed217df6ca15452dc Mon Sep 17 00:00:00 2001 From: Tobias Schlatter Date: Thu, 13 Mar 2014 14:47:31 +0100 Subject: [PATCH] Minor fixes in test. The equals method always returned true. 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). --- test/files/run/t6196.scala | 2 +- test/files/run/t6200.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/files/run/t6196.scala b/test/files/run/t6196.scala index 16c2c7409dda..a75911fb9eb9 100644 --- a/test/files/run/t6196.scala +++ b/test/files/run/t6196.scala @@ -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 } diff --git a/test/files/run/t6200.scala b/test/files/run/t6200.scala index 9a5d91e042bf..75600cd557bb 100644 --- a/test/files/run/t6200.scala +++ b/test/files/run/t6200.scala @@ -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 }