diff options
author | Tobias Schlatter <tobias@meisch.ch> | 2014-03-13 14:47:31 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-13 14:47:31 +0100 |
commit | 4b0b673c7d1e7ee9c979680ed217df6ca15452dc (patch) | |
tree | 1f68cbdeeeafa1fda482ff953f83a5222d056cc5 /test/files/run | |
parent | 9c38e86a5526887f93a3f031b19a0e4fa31745d3 (diff) | |
download | scala-4b0b673c7d1e7ee9c979680ed217df6ca15452dc.tar.gz scala-4b0b673c7d1e7ee9c979680ed217df6ca15452dc.tar.bz2 scala-4b0b673c7d1e7ee9c979680ed217df6ca15452dc.zip |
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).
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t6196.scala | 2 | ||||
-rw-r--r-- | 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 16c2c7409d..a75911fb9e 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 9a5d91e042..75600cd557 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 } |