diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-03-23 14:28:23 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-03-23 14:28:23 +0000 |
commit | 26643c870b0308e903eb097cae8bae78180c0f4a (patch) | |
tree | 58763275fb7adeff67f7434f777c76fe2346d77e /test | |
parent | b40373367e6803349470ecabc3ef646f50353139 (diff) | |
download | scala-26643c870b0308e903eb097cae8bae78180c0f4a.tar.gz scala-26643c870b0308e903eb097cae8bae78180c0f4a.tar.bz2 scala-26643c870b0308e903eb097cae8bae78180c0f4a.zip |
Merged revisions 24541-24548 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r24541 | odersky | 2011-03-22 17:46:49 +0100 (Tue, 22 Mar 2011) | 1 line
Added headers with copyright messages.
........
r24542 | odersky | 2011-03-22 18:18:09 +0100 (Tue, 22 Mar 2011) | 1 line
Added test that signatures conform to their erasures. Work in
progress. Review by extempore. ........ r24543 | prokopec | 2011-03-22
19:22:21 +0100 (Tue, 22 Mar 2011) | 1 line
Adding the `seq` method to all collections. Removing `pforeach`.
........ r24544 | prokopec | 2011-03-22 19:22:25 +0100 (Tue, 22 Mar
2011) | 6 lines
Implementing foreach to work in parallel in ParIterableLike.
Doing a bunch of refactoring around in the collection framework to
ensure a parallel foreach is never called with a side-effecting
method. This still leaves other parts of the standard library and the
compiler unguarded.
No review.
........
r24545 | prokopec | 2011-03-22 19:23:28 +0100 (Tue, 22 Mar 2011) | 3 lines
Adding some tests for #3651.
No review.
........
r24546 | odersky | 2011-03-22 23:59:03 +0100 (Tue, 22 Mar 2011) | 1 line
Better signature avoidance. Review by extempore.
........
r24547 | extempore | 2011-03-23 08:59:18 +0100 (Wed, 23 Mar 2011) | 11 lines
My early attempts to implement non-integral ranges in a way which was
useful without having lots of floating point traps were less than
successful. One of the bigger backfires is that the requirement not
to round (trying, and failing anyway, to avoid surprises with methods
like "contains") inflicts runtime errors.
The simple way to improve this, which seems a good idea anyway, is to
make the default math context something less inclined to exceptions.
Default BigDecimal mc is now DECIMAL128. References #1812, #4201 and
puts #4201 back to normal priority. Review by community. ........ r24548
| magarcia | 2011-03-23 13:33:27 +0100 (Wed, 23 Mar 2011) | 1 line
sn.OClone caused checkinit failure when assigned to
CompilerTermNames.clone_ . review by rytz. ........
Diffstat (limited to 'test')
-rw-r--r-- | test/disabled/coder/Coder.scala (renamed from test/disabled/run/coder/Coder.scala) | 0 | ||||
-rw-r--r-- | test/disabled/coder/Dictionary.scala (renamed from test/disabled/run/coder/Dictionary.scala) | 0 | ||||
-rw-r--r-- | test/files/run/bug4201.scala | 7 | ||||
-rw-r--r-- | test/files/run/pc-conversions.scala | 16 | ||||
-rw-r--r-- | test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala | 2 | ||||
-rw-r--r-- | test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala | 2 | ||||
-rw-r--r-- | test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala | 2 | ||||
-rw-r--r-- | test/files/scalacheck/parallel-collections/ParallelSetCheck.scala | 2 | ||||
-rw-r--r-- | test/files/specialized/tb3651.check | 1 | ||||
-rw-r--r-- | test/files/specialized/tb3651.scala | 11 | ||||
-rw-r--r-- | test/files/specialized/tc3651.check | 1 | ||||
-rw-r--r-- | test/files/specialized/tc3651.scala | 15 |
12 files changed, 39 insertions, 20 deletions
diff --git a/test/disabled/run/coder/Coder.scala b/test/disabled/coder/Coder.scala index 06dd4b6355..06dd4b6355 100644 --- a/test/disabled/run/coder/Coder.scala +++ b/test/disabled/coder/Coder.scala diff --git a/test/disabled/run/coder/Dictionary.scala b/test/disabled/coder/Dictionary.scala index 7b354b9aa8..7b354b9aa8 100644 --- a/test/disabled/run/coder/Dictionary.scala +++ b/test/disabled/coder/Dictionary.scala diff --git a/test/files/run/bug4201.scala b/test/files/run/bug4201.scala new file mode 100644 index 0000000000..f6c0acaf94 --- /dev/null +++ b/test/files/run/bug4201.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]): Unit = { + val f = 0.0 to 1.0 by 1.0 / 3.0 + assert(f.size == 4) + } +} + diff --git a/test/files/run/pc-conversions.scala b/test/files/run/pc-conversions.scala index 23fcb9fa59..3121d82944 100644 --- a/test/files/run/pc-conversions.scala +++ b/test/files/run/pc-conversions.scala @@ -49,8 +49,6 @@ object Test { assertToPar(parallel.immutable.ParHashSet(1 -> 3)) assertToParWoMap(immutable.Range(1, 10, 2)) - - assertToParIt(List(1 -> 1, 2 -> 2, 3 -> 3).iterator) } def assertSeq[T](pc: parallel.ParIterable[T]) = assert(pc.seq == pc) @@ -86,18 +84,4 @@ object Test { assert(xs.par.toSet == xs.toSet) } - def assertToParIt[K, V](xs: =>Iterator[(K, V)]) { - assert(xs.toIterable.par == xs.toIterable) - assert(xs.par.toIterable == xs.toIterable) - - assert(xs.toSeq.par == xs.toSeq) - assert(xs.par.toSeq == xs.toSeq) - - assert(xs.toSet.par == xs.toSet) - assert(xs.par.toSet == xs.toSet) - - assert(xs.toMap.par == xs.toMap) - assert(xs.par.toMap == xs.toMap) - } - } diff --git a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala index 9ddd5781b9..744d22f05c 100644 --- a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala +++ b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala @@ -15,7 +15,7 @@ import scala.collection.parallel._ abstract class ParallelIterableCheck[T](collName: String) extends Properties(collName) with Operators[T] { - type CollType <: ParIterable[T] with Sequentializable[T, Iterable[T]] + type CollType <: ParIterable[T] def values: Seq[Gen[T]] def ofSize(vals: Seq[Gen[T]], sz: Int): Iterable[T] diff --git a/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala b/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala index 6b30f61b57..53e56e9700 100644 --- a/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala +++ b/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala @@ -15,7 +15,7 @@ import scala.collection.parallel._ abstract class ParallelMapCheck[K, V](collname: String) extends ParallelIterableCheck[(K, V)](collname) { - type CollType <: ParMap[K, V] with Sequentializable[(K, V), Map[K, V]] + type CollType <: ParMap[K, V] property("gets iterated keys") = forAll(collectionPairs) { case (t, coll) => diff --git a/test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala b/test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala index 4373157311..3f8a8ad4f5 100644 --- a/test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala +++ b/test/files/scalacheck/parallel-collections/ParallelSeqCheck.scala @@ -17,7 +17,7 @@ import scala.collection.parallel._ abstract class ParallelSeqCheck[T](collName: String) extends ParallelIterableCheck[T](collName) with SeqOperators[T] { - type CollType <: collection.parallel.ParSeq[T] with Sequentializable[T, Seq[T]] + type CollType <: collection.parallel.ParSeq[T] def ofSize(vals: Seq[Gen[T]], sz: Int): Seq[T] diff --git a/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala b/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala index 092f4823df..56f7832fed 100644 --- a/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala +++ b/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala @@ -15,7 +15,7 @@ import scala.collection.parallel._ abstract class ParallelSetCheck[T](collname: String) extends ParallelIterableCheck[T](collname) { - type CollType <: ParSet[T] with Sequentializable[T, Set[T]] + type CollType <: ParSet[T] property("gets iterated keys") = forAll(collectionPairs) { case (t, coll) => diff --git a/test/files/specialized/tb3651.check b/test/files/specialized/tb3651.check new file mode 100644 index 0000000000..c227083464 --- /dev/null +++ b/test/files/specialized/tb3651.check @@ -0,0 +1 @@ +0
\ No newline at end of file diff --git a/test/files/specialized/tb3651.scala b/test/files/specialized/tb3651.scala new file mode 100644 index 0000000000..1f64080649 --- /dev/null +++ b/test/files/specialized/tb3651.scala @@ -0,0 +1,11 @@ +class Klass[@specialized(Long) A]( val a: A ) + +class LongKlass( override val a: Long ) extends Klass[Long](a) + +object Test { + def main(args: Array[String]) { + val lk = new LongKlass(10) + lk.a + println(runtime.BoxesRunTime.longBoxCount) + } +} diff --git a/test/files/specialized/tc3651.check b/test/files/specialized/tc3651.check new file mode 100644 index 0000000000..c227083464 --- /dev/null +++ b/test/files/specialized/tc3651.check @@ -0,0 +1 @@ +0
\ No newline at end of file diff --git a/test/files/specialized/tc3651.scala b/test/files/specialized/tc3651.scala new file mode 100644 index 0000000000..447edee3bf --- /dev/null +++ b/test/files/specialized/tc3651.scala @@ -0,0 +1,15 @@ + + + + +class Base[@specialized(Int) A](val a: A) + +class Derived(override val a: Int) extends Base[Int](a) + +object Test { + def main(args: Array[String]) { + val lk: Base[Int] = new Derived(10) + lk.a + println(runtime.BoxesRunTime.integerBoxCount) + } +} |