diff options
author | Paul Phillips <paulp@improving.org> | 2009-10-25 03:56:13 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-10-25 03:56:13 +0000 |
commit | 2cef1c58a54c996243fb85630cce841073c18650 (patch) | |
tree | b3c5859df83a1c2a0f61c0af27e8d29d242e2890 /test/files/run/bug2512.scala | |
parent | 460a434698ec97cd3dfb74a18d45ab08ea95debc (diff) | |
download | scala-2cef1c58a54c996243fb85630cce841073c18650.tar.gz scala-2cef1c58a54c996243fb85630cce841073c18650.tar.bz2 scala-2cef1c58a54c996243fb85630cce841073c18650.zip |
Fix and test case for #2512, plus lots of time ...
Fix and test case for #2512, plus lots of time expended tuning HashSet
starting sizes and growth rate, with almost nothing to show for it (but
I did determine that "shadowed" is constructed identically something
like 10,000 times, so there is probably a cache to be had there.)
Diffstat (limited to 'test/files/run/bug2512.scala')
-rw-r--r-- | test/files/run/bug2512.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/bug2512.scala b/test/files/run/bug2512.scala new file mode 100644 index 0000000000..514b26650f --- /dev/null +++ b/test/files/run/bug2512.scala @@ -0,0 +1,14 @@ +import scala.tools.nsc.util.HashSet + +object Test +{ + val runs = 10000 + class Bop + + def main(args: Array[String]): Unit = { + val set: HashSet[Bop] = new HashSet("Bop", 16) + (1 to runs).toList foreach (_ => set addEntry new Bop) + + assert(runs == set.size && set.size == set.iterator.length) + } +} |