File: t6853.scala

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (18 lines) | stat: -rw-r--r-- 550 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test cases: the only place we can cut and paste without crying
// ourself to sleep.
object Test {

  def main(args: Array[String]): Unit = {
    // First testing the basic operations
    val m = collection.mutable.ListMap[String, Int]()
    var i = 0
    while(i < 2) { m += ("foo" + i) -> i; i = i+1}
    assert(m == Map("foo1"->1,"foo0"->0))
    m-= "foo0"
    assert(m == Map("foo1"->1))
    // Now checking if it scales as described in SI-6853
    i = 0
    while(i < 80000) { m += ("foo" + i) -> i; i = i+1}
    assert(m.size == 80000)
  }
}