diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/constrained-types.check | 4 | ||||
-rw-r--r-- | test/files/run/hashset.check | 26 | ||||
-rw-r--r-- | test/files/run/hashset.scala | 48 | ||||
-rw-r--r-- | test/files/run/hashsetremove.check | 6 | ||||
-rw-r--r-- | test/files/run/hashsetremove.scala | 13 | ||||
-rw-r--r-- | test/files/run/macro-repl-basic.check | 4 | ||||
-rw-r--r-- | test/files/run/reflection-repl-classes.check | 2 | ||||
-rw-r--r-- | test/files/run/repl-bare-expr.check | 4 | ||||
-rw-r--r-- | test/files/run/repl-paste.check | 2 | ||||
-rw-r--r-- | test/files/run/t4671.check | 2 | ||||
-rw-r--r-- | test/files/run/t5655.check | 2 |
11 files changed, 103 insertions, 10 deletions
diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check index da97a378e6..d4b8692fa3 100644 --- a/test/files/run/constrained-types.check +++ b/test/files/run/constrained-types.check @@ -37,7 +37,7 @@ scala> object Stuff { val x = "hello" val y : Int @Annot(x) = 10 } -defined module Stuff +defined object Stuff scala> @@ -127,7 +127,7 @@ defined class rep scala> scala> object A { val x = "hello" : String @ rep } -defined module A +defined object A warning: previously defined class A is not a companion to object A. Companions must be defined together; you may wish to use :paste mode for this. diff --git a/test/files/run/hashset.check b/test/files/run/hashset.check new file mode 100644 index 0000000000..9542a1ff48 --- /dev/null +++ b/test/files/run/hashset.check @@ -0,0 +1,26 @@ +*** HashSet primitives +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 + +*** HashSet Strings with null +null true +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,10,11,12,13,14,15,16,17,18,19,2,3,4,5,6,7,8,9,null +null false +0 false,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true + +*** ParHashSet primitives +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 + +*** ParHashSet Strings with null +null true +0 true,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true +20 false,21 false,22 false,23 false,24 false,25 false,26 false,27 false,28 false,29 false,30 false,31 false,32 false,33 false,34 false,35 false,36 false,37 false,38 false,39 false +0,1,10,11,12,13,14,15,16,17,18,19,2,3,4,5,6,7,8,9,null +null false +0 false,1 true,10 true,11 true,12 true,13 true,14 true,15 true,16 true,17 true,18 true,19 true,2 true,3 true,4 true,5 true,6 true,7 true,8 true,9 true + diff --git a/test/files/run/hashset.scala b/test/files/run/hashset.scala new file mode 100644 index 0000000000..299dce3aec --- /dev/null +++ b/test/files/run/hashset.scala @@ -0,0 +1,48 @@ +import scala.collection.generic.{Growable, Shrinkable} +import scala.collection.GenSet +import scala.collection.mutable.FlatHashTable +import scala.collection.mutable.HashSet +import scala.collection.parallel.mutable.ParHashSet + +object Test extends App { + test(new Creator{ + def create[A] = new HashSet[A] + def hashSetType = "HashSet" + }) + + test(new Creator{ + def create[A] = new ParHashSet[A] + def hashSetType = "ParHashSet" + }) + + + def test(creator : Creator) { + println("*** " + creator.hashSetType + " primitives") + val h1 = creator.create[Int] + for (i <- 0 until 20) h1 += i + println((for (i <- 0 until 20) yield i + " " + (h1 contains i)).toList.sorted mkString(",")) + println((for (i <- 20 until 40) yield i + " " + (h1 contains i)).toList.sorted mkString(",")) + println(h1.toList.sorted mkString ",") + println + + println("*** " + creator.hashSetType + " Strings with null") + val h2 = creator.create[String] + h2 += null + for (i <- 0 until 20) h2 += "" + i + println("null " + (h2 contains null)) + println((for (i <- 0 until 20) yield i + " " + (h2 contains ("" + i))).toList.sorted mkString(",")) + println((for (i <- 20 until 40) yield i + " " + (h2 contains ("" + i))).toList.sorted mkString(",")) + println((h2.toList map {x => "" + x}).sorted mkString ",") + + h2 -= null + h2 -= "" + 0 + println("null " + (h2 contains null)) + println((for (i <- 0 until 20) yield i + " " + (h2 contains ("" + i))).toList.sorted mkString(",")) + println + } + + trait Creator { + def create[A] : GenSet[A] with Cloneable with FlatHashTable[A] with Growable[A] with Shrinkable[A] + def hashSetType : String + } +}
\ No newline at end of file diff --git a/test/files/run/hashsetremove.check b/test/files/run/hashsetremove.check new file mode 100644 index 0000000000..8de9826895 --- /dev/null +++ b/test/files/run/hashsetremove.check @@ -0,0 +1,6 @@ +remove 0 should be false, was false +contains 1 should be true, was true +remove 1 should be true, was true +contains 1 should be false, was false +remove 1 should be false, was false +contains 1 should be false, was false diff --git a/test/files/run/hashsetremove.scala b/test/files/run/hashsetremove.scala new file mode 100644 index 0000000000..7b82a9909b --- /dev/null +++ b/test/files/run/hashsetremove.scala @@ -0,0 +1,13 @@ +import scala.collection.mutable.HashSet + + +object Test extends App { + val h = new HashSet[Int] + h += 1 + println(s"remove 0 should be false, was ${h remove 0}") + println(s"contains 1 should be true, was ${h contains 1}") + println(s"remove 1 should be true, was ${h remove 1}") + println(s"contains 1 should be false, was ${h contains 1}") + println(s"remove 1 should be false, was ${h remove 1}") + println(s"contains 1 should be false, was ${h contains 1}") + }
\ No newline at end of file diff --git a/test/files/run/macro-repl-basic.check b/test/files/run/macro-repl-basic.check index 5323f429da..8d43a3aa16 100644 --- a/test/files/run/macro-repl-basic.check +++ b/test/files/run/macro-repl-basic.check @@ -30,7 +30,7 @@ scala> object Impls { c.Expr[Int](body) } } -defined module Impls +defined object Impls scala> object Macros { object Shmacros { @@ -40,7 +40,7 @@ scala> object Macros { }; class Macros { def quux(x: Int): Int = macro Impls.quux } -defined module Macros +defined object Macros defined class Macros scala> diff --git a/test/files/run/reflection-repl-classes.check b/test/files/run/reflection-repl-classes.check index 606d67ce5e..d70db59b85 100644 --- a/test/files/run/reflection-repl-classes.check +++ b/test/files/run/reflection-repl-classes.check @@ -22,7 +22,7 @@ scala> object defs { val method = im.symbol.typeSignature.member(u.TermName("foo")).asMethod val mm = im.reflectMethod(method) } -defined module defs +defined object defs scala> import defs._ import defs._ diff --git a/test/files/run/repl-bare-expr.check b/test/files/run/repl-bare-expr.check index 8b6434e986..a92243c7c0 100644 --- a/test/files/run/repl-bare-expr.check +++ b/test/files/run/repl-bare-expr.check @@ -31,7 +31,7 @@ scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Mooo <console>:7: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ -defined module Cow +defined object Cow defined class Moo bippy: Int res2: Int = 105 @@ -39,7 +39,7 @@ res2: Int = 105 scala> scala> object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy -defined module Bovine +defined object Bovine defined class Ruminant res3: Int = 216 diff --git a/test/files/run/repl-paste.check b/test/files/run/repl-paste.check index d3e171fbfb..e4c407c6e8 100644 --- a/test/files/run/repl-paste.check +++ b/test/files/run/repl-paste.check @@ -21,7 +21,7 @@ val x = (new Dingus).y // Exiting paste mode, now interpreting. defined class Dingus -defined module Dingus +defined object Dingus x: Int = 110 scala> diff --git a/test/files/run/t4671.check b/test/files/run/t4671.check index 4699818cd4..d4f8af480a 100644 --- a/test/files/run/t4671.check +++ b/test/files/run/t4671.check @@ -2,7 +2,7 @@ Type in expressions to have them evaluated. Type :help for more information. scala> object o { val file = sys.props("partest.cwd") + "/t4671.scala" } -defined module o +defined object o scala> val s = scala.io.Source.fromFile(o.file) s: scala.io.BufferedSource = non-empty iterator diff --git a/test/files/run/t5655.check b/test/files/run/t5655.check index 43ebd50e7a..1103b0e36f 100644 --- a/test/files/run/t5655.check +++ b/test/files/run/t5655.check @@ -4,7 +4,7 @@ Type :help for more information. scala> scala> object x { def x={} } -defined module x +defined object x scala> import x._ import x._ |