summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2011-04-19 12:10:57 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2011-04-19 12:10:57 +0000
commita387c9fd9b88861e5ca6bfae59c0f4f540fd4133 (patch)
treef89c2de13a8e0d88becf0c0acab68c9779fac194 /test
parent260a41241e7c4bde3280fb80d2a509102c77c114 (diff)
downloadscala-a387c9fd9b88861e5ca6bfae59c0f4f540fd4133.tar.gz
scala-a387c9fd9b88861e5ca6bfae59c0f4f540fd4133.tar.bz2
scala-a387c9fd9b88861e5ca6bfae59c0f4f540fd4133.zip
Merged revisions 24749-24771,24773-24774,24776-...
Merged revisions 24749-24771,24773-24774,24776-24779 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r24749 | odersky | 2011-04-13 17:07:21 +0200 (Wed, 13 Apr 2011) | 1 line Fixes my part of #4283 by inserting another cast pre-emptively when an IllegalAccess error is possible in an erasure-inserted cast. Review by extempore. ........ r24750 | dragos | 2011-04-13 18:15:37 +0200 (Wed, 13 Apr 2011) | 1 line Warn when the jar file cannot be found when loading a plugin. no review. ........ r24751 | dragos | 2011-04-13 18:15:43 +0200 (Wed, 13 Apr 2011) | 1 line Closes #4283. no review. ........ r24752 | prokopec | 2011-04-13 18:31:42 +0200 (Wed, 13 Apr 2011) | 45 lines Refactoring the collections api to support differentiation between referring to a sequential collection and a parallel collection, and to support referring to both types of collections. New set of traits Gen* are now superclasses of both their * and Par* subclasses. For example, GenIterable is a superclass of both Iterable and ParIterable. Iterable and ParIterable are not in a subclassing relation. The new class hierarchy is illustrated below (simplified, not all relations and classes are shown): TraversableOnce --> GenTraversableOnce ^ ^ | | Traversable --> GenTraversable ^ ^ | | Iterable --> GenIterable <-- ParIterable ^ ^ ^ | | | Seq --> GenSeq <-- ParSeq (the *Like, *View and *ViewLike traits have a similar hierarchy) General views extract common view functionality from parallel and sequential collections. This design also allows for more flexible extensions to the collections framework. It also allows slowly factoring out common functionality up into Gen* traits. From now on, it is possible to write this: import collection._ val p = parallel.ParSeq(1, 2, 3) val g: GenSeq[Int] = p // meaning a General Sequence val s = g.seq // type of s is Seq[Int] for (elem <- g) { // do something without guarantees on sequentiality of foreach // this foreach may be executed in parallel } for (elem <- s) { // do something with a guarantee that foreach is executed in order, sequentially } for (elem <- p) { // do something concurrently, in parallel } This also means that some signatures had to be changed. For example, method `flatMap` now takes `A => GenTraversableOnce[B]`, and `zip` takes a `GenIterable[B]`. Also, there are mutable & immutable Gen* trait variants. They have generic companion functionality. ........ r24753 | prokopec | 2011-04-13 18:31:58 +0200 (Wed, 13 Apr 2011) | 3 lines Fixes and closes #4405. No review. ........ r24754 | prokopec | 2011-04-13 18:32:01 +0200 (Wed, 13 Apr 2011) | 3 lines Fixed some tests, renamed from Any to Gen. No review. ........ r24755 | prokopec | 2011-04-13 18:32:04 +0200 (Wed, 13 Apr 2011) | 3 lines Further fixes #4405. No review. ........ r24756 | prokopec | 2011-04-13 18:32:09 +0200 (Wed, 13 Apr 2011) | 3 lines Added test case for #4459. No review. ........ r24757 | extempore | 2011-04-13 21:00:56 +0200 (Wed, 13 Apr 2011) | 1 line New starr based on r24749. No review. ........ r24758 | dragos | 2011-04-13 21:12:57 +0200 (Wed, 13 Apr 2011) | 1 line Revert "Closes #4283. no review." because of failing tests. ........ r24759 | extempore | 2011-04-14 06:15:50 +0200 (Thu, 14 Apr 2011) | 2 lines Tests which run have to be called "Test". Fixes failing test and renames file to avoid ant's brainlessness, no review. ........ r24760 | extempore | 2011-04-14 08:38:35 +0200 (Thu, 14 Apr 2011) | 9 lines Doing a little polishing on the parallel collections refactor (which overall looks like a big improvement.) I went for some simpler wording and moved a number of scaladoc tags around because the rug had been pulled out from under their feet. This leaves a lot undone, but since many of the docs need to be reworded before they can move from e.g. SeqLike to GenSeqLike, and I'm not well informed on exactly how these abstractions are being presented, I stayed in the safe zone. Review by prokopec. ........ r24761 | phaller | 2011-04-14 11:11:10 +0200 (Thu, 14 Apr 2011) | 1 line Closed #4454. Applied patch provided in ticket. No review. ........ r24762 | dragos | 2011-04-14 15:48:00 +0200 (Thu, 14 Apr 2011) | 1 line This time, fixed #4283. no review. ........ r24763 | extempore | 2011-04-14 16:25:46 +0200 (Thu, 14 Apr 2011) | 4 lines Of late the test which fires up the window server, which has already been the source of undue quantities of inconvenience, has taken to hanging indefinitely when I run the test suite on a remote machine. Rope at end, goodbye test, no review. ........ r24764 | prokopec | 2011-04-14 18:09:33 +0200 (Thu, 14 Apr 2011) | 4 lines Adding some docs refactorings. Also, added some docs variables to Gen* traits that were missing. No review. ........ r24765 | extempore | 2011-04-14 21:33:39 +0200 (Thu, 14 Apr 2011) | 2 lines Some patches to jline, and new jar. Thanks to Kenji Matsuoka for improving the keybindings. No review. ........ r24766 | extempore | 2011-04-14 23:05:12 +0200 (Thu, 14 Apr 2011) | 3 lines Adds "since" field to @deprecated. Thanks to Simon Ochsenreither for the patch, as it's a change I've always wanted. Moving up in the glamorous world of scala commits! No review. ........ r24767 | extempore | 2011-04-14 23:06:14 +0200 (Thu, 14 Apr 2011) | 3 lines Various addenda to soc's patch: regenerating Product/Tuple/Function classes and AnyVal sources, making versioning consistent, etc. Closes #4477, no review. ........ r24768 | extempore | 2011-04-15 04:39:32 +0200 (Fri, 15 Apr 2011) | 3 lines Some mopping up having to do with deprecated gaining an argument, which may or may not cure scaladoc of its current assertion failure. No review. ........ r24769 | extempore | 2011-04-15 07:05:53 +0200 (Fri, 15 Apr 2011) | 1 line Fixing a couple more tests, no review. ........ r24770 | extempore | 2011-04-15 08:55:32 +0200 (Fri, 15 Apr 2011) | 6 lines Having been tortured by remorse ever since tiark told me that r23934 had made the hashmap slower, I crushed my previous efforts under the heel of my boot, threw all the types out the window, poured acid on them, and turned all the dials to the far other extreme. Pity the man who will sell his soul for a few CPU cycles. (I am that man.) Review by rompf. ........ r24771 | prokopec | 2011-04-15 09:54:54 +0200 (Fri, 15 Apr 2011) | 3 lines Couple of fixes to the usecases in docs. No review. ........ r24773 | kzys | 2011-04-15 18:12:22 +0200 (Fri, 15 Apr 2011) | 2 lines [scaladoc] Strike-through for deprecated symbols on the reference index. Closes #4471. Review by dubochet. ........ r24774 | extempore | 2011-04-15 23:03:44 +0200 (Fri, 15 Apr 2011) | 3 lines Added a script in tools for deploying maven artifacts locally, since it always takes me an eternity to figure out slash remember how to do it. No review. ........ r24776 | extempore | 2011-04-17 21:58:15 +0200 (Sun, 17 Apr 2011) | 2 lines Added releaseVersion and developmentVersion to Properties so people don't all have to parse the versionString. No review. ........ r24777 | extempore | 2011-04-17 23:28:03 +0200 (Sun, 17 Apr 2011) | 1 line Revised that last botched commit. No review. ........ r24778 | odersky | 2011-04-19 11:52:59 +0200 (Tue, 19 Apr 2011) | 1 line Trying to get build times down by refining implicit searches. Implicit infos associated with toplevel classes are cached now. Review by rompf. ........ r24779 | odersky | 2011-04-19 12:56:58 +0200 (Tue, 19 Apr 2011) | 1 line Further optimizations of implicits. Now, improves checks between static members are cached as well. Review by rompf. ........
Diffstat (limited to 'test')
-rw-r--r--test/disabled/jvm/JavaInteraction.check (renamed from test/files/jvm/JavaInteraction.check)0
-rw-r--r--test/disabled/jvm/JavaInteraction.scala (renamed from test/files/jvm/JavaInteraction.scala)0
-rw-r--r--test/disabled/presentation/simple-tests.check (renamed from test/files/presentation/simple-tests.check)0
-rw-r--r--test/disabled/presentation/simple-tests.javaopts (renamed from test/files/presentation/simple-tests.javaopts)0
-rw-r--r--test/disabled/presentation/simple-tests.opts (renamed from test/files/presentation/simple-tests.opts)0
-rw-r--r--test/disabled/scalacheck/HashTrieSplit.scala47
-rw-r--r--test/files/jvm/ticket4283/AbstractFoo.java5
-rw-r--r--test/files/jvm/ticket4283/ScalaBipp.scala5
-rw-r--r--test/files/jvm/ticket4283/Test.scala4
-rwxr-xr-xtest/files/neg/t3115.scala2
-rw-r--r--test/files/neg/t3774.check4
-rw-r--r--test/files/pos/spec-List.scala2
-rw-r--r--test/files/pos/t2799.scala2
-rw-r--r--test/files/run/pc-conversions.scala13
-rw-r--r--test/files/run/t4459.scala12
-rw-r--r--test/files/scalacheck/HashTrieSplit.scala4
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala6
-rw-r--r--test/files/scalacheck/parallel-collections/pc.scala10
-rw-r--r--test/pending/run/t4283/AbstractFoo.java3
-rw-r--r--test/pending/run/t4283/IllegalAccess.scala14
-rw-r--r--test/scaladoc/resources/Trac4471.scala9
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala32
22 files changed, 148 insertions, 26 deletions
diff --git a/test/files/jvm/JavaInteraction.check b/test/disabled/jvm/JavaInteraction.check
index fb9d3cdd8c..fb9d3cdd8c 100644
--- a/test/files/jvm/JavaInteraction.check
+++ b/test/disabled/jvm/JavaInteraction.check
diff --git a/test/files/jvm/JavaInteraction.scala b/test/disabled/jvm/JavaInteraction.scala
index 26fbc17e58..26fbc17e58 100644
--- a/test/files/jvm/JavaInteraction.scala
+++ b/test/disabled/jvm/JavaInteraction.scala
diff --git a/test/files/presentation/simple-tests.check b/test/disabled/presentation/simple-tests.check
index b90dfce77c..b90dfce77c 100644
--- a/test/files/presentation/simple-tests.check
+++ b/test/disabled/presentation/simple-tests.check
diff --git a/test/files/presentation/simple-tests.javaopts b/test/disabled/presentation/simple-tests.javaopts
index 4af888f9c2..4af888f9c2 100644
--- a/test/files/presentation/simple-tests.javaopts
+++ b/test/disabled/presentation/simple-tests.javaopts
diff --git a/test/files/presentation/simple-tests.opts b/test/disabled/presentation/simple-tests.opts
index 8529bbf1a0..8529bbf1a0 100644
--- a/test/files/presentation/simple-tests.opts
+++ b/test/disabled/presentation/simple-tests.opts
diff --git a/test/disabled/scalacheck/HashTrieSplit.scala b/test/disabled/scalacheck/HashTrieSplit.scala
new file mode 100644
index 0000000000..6b20efe12b
--- /dev/null
+++ b/test/disabled/scalacheck/HashTrieSplit.scala
@@ -0,0 +1,47 @@
+
+
+
+
+
+import collection._
+
+
+
+
+// checks whether hash tries split their iterators correctly
+// even after some elements have been traversed
+object Test {
+ def main(args: Array[String]) {
+ doesSplitOk
+ }
+
+ def doesSplitOk = {
+ val sz = 2000
+ var ht = new parallel.immutable.ParHashMap[Int, Int]
+ // println("creating trie")
+ for (i <- 0 until sz) ht += ((i + sz, i))
+ // println("created trie")
+ for (n <- 0 until (sz - 1)) {
+ // println("---------> n = " + n)
+ val pit = ht.parallelIterator
+ val pit2 = ht.parallelIterator
+ var i = 0
+ while (i < n) {
+ pit.next
+ pit2.next
+ i += 1
+ }
+ // println("splitting")
+ val pits = pit.split
+ val fst = pits(0).toSet
+ val snd = pits(1).toSet
+ val orig = pit2.toSet
+ if (orig.size != (fst.size + snd.size) || orig != (fst ++ snd)) {
+ println("Original: " + orig)
+ println("First: " + fst)
+ println("Second: " + snd)
+ assert(false)
+ }
+ }
+ }
+}
diff --git a/test/files/jvm/ticket4283/AbstractFoo.java b/test/files/jvm/ticket4283/AbstractFoo.java
new file mode 100644
index 0000000000..74f3827fe3
--- /dev/null
+++ b/test/files/jvm/ticket4283/AbstractFoo.java
@@ -0,0 +1,5 @@
+package test;
+
+/* package private */ class AbstractFoo {
+ public int t;
+}
diff --git a/test/files/jvm/ticket4283/ScalaBipp.scala b/test/files/jvm/ticket4283/ScalaBipp.scala
new file mode 100644
index 0000000000..36dea9f4de
--- /dev/null
+++ b/test/files/jvm/ticket4283/ScalaBipp.scala
@@ -0,0 +1,5 @@
+package test
+
+class ScalaBipp extends AbstractFoo {
+ def make: Option[ScalaBipp] = Option(this)
+}
diff --git a/test/files/jvm/ticket4283/Test.scala b/test/files/jvm/ticket4283/Test.scala
new file mode 100644
index 0000000000..9bbfaab928
--- /dev/null
+++ b/test/files/jvm/ticket4283/Test.scala
@@ -0,0 +1,4 @@
+
+object Test extends App {
+ val x = (new test.ScalaBipp).make.get.t // java.lang.IllegalAccessError: tried to access class test.AbstractFoo from class other.IllegalAccess$
+}
diff --git a/test/files/neg/t3115.scala b/test/files/neg/t3115.scala
index 4aeeb4063e..3888085593 100755
--- a/test/files/neg/t3115.scala
+++ b/test/files/neg/t3115.scala
@@ -1,5 +1,5 @@
object sc {
- @deprecated("") object Math
+ @deprecated("", "2.8.0") object Math
}
object Test {
diff --git a/test/files/neg/t3774.check b/test/files/neg/t3774.check
index 59c63c4ee8..ea35c50541 100644
--- a/test/files/neg/t3774.check
+++ b/test/files/neg/t3774.check
@@ -1,6 +1,6 @@
t3774.scala:4: error: overloaded method value ++ with alternatives:
- [B1 >: List[Int]](xs: scala.collection.TraversableOnce[((Int, Int), B1)])scala.collection.immutable.Map[(Int, Int),B1] <and>
- [B >: ((Int, Int), List[Int]),That](that: scala.collection.TraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Map[(Int, Int),List[Int]],B,That])That
+ [B1 >: List[Int]](xs: scala.collection.GenTraversableOnce[((Int, Int), B1)])scala.collection.immutable.Map[(Int, Int),B1] <and>
+ [B >: ((Int, Int), List[Int]),That](that: scala.collection.GenTraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Map[(Int, Int),List[Int]],B,That])That
cannot be applied to (scala.collection.immutable.IndexedSeq[((Int, Int), scala.collection.immutable.Range.Inclusive)])
Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)})
^
diff --git a/test/files/pos/spec-List.scala b/test/files/pos/spec-List.scala
index e3055f3051..04ab7d1543 100644
--- a/test/files/pos/spec-List.scala
+++ b/test/files/pos/spec-List.scala
@@ -144,7 +144,7 @@ sealed trait List[@specialized +A] extends LinearSeq[A]
/** Create a new list which contains all elements of this list
* followed by all elements of Traversable `that'
*/
- override def ++[B >: A, That](xs: TraversableOnce[B])(implicit bf: CanBuildFrom[List[A], B, That]): That = {
+ override def ++[B >: A, That](xs: GenTraversableOnce[B])(implicit bf: CanBuildFrom[List[A], B, That]): That = {
val b = bf(this)
if (b.isInstanceOf[ListBuffer[_]]) (this ::: xs.toList).asInstanceOf[That]
else super.++(xs)
diff --git a/test/files/pos/t2799.scala b/test/files/pos/t2799.scala
index fe93c0e301..7710cce26c 100644
--- a/test/files/pos/t2799.scala
+++ b/test/files/pos/t2799.scala
@@ -1 +1 @@
-@deprecated("hi mom") case class Bob ()
+@deprecated("hi mom", "") case class Bob ()
diff --git a/test/files/run/pc-conversions.scala b/test/files/run/pc-conversions.scala
index 3121d82944..6be0f99355 100644
--- a/test/files/run/pc-conversions.scala
+++ b/test/files/run/pc-conversions.scala
@@ -7,7 +7,7 @@ import collection._
object Test {
def main(args: Array[String]) {
- // disabled
+ testConversions
}
def testConversions {
@@ -49,13 +49,18 @@ object Test {
assertToPar(parallel.immutable.ParHashSet(1 -> 3))
assertToParWoMap(immutable.Range(1, 10, 2))
+
+ // seq and par again conversions)
+ assertSeqPar(parallel.mutable.ParArray(1, 2, 3))
}
+ def assertSeqPar[T](pc: parallel.ParIterable[T]) = pc.seq.par == pc
+
def assertSeq[T](pc: parallel.ParIterable[T]) = assert(pc.seq == pc)
- def assertPar[T, P <: Parallel](xs: Iterable[T]) = assert(xs == xs.par)
+ def assertPar[T, P <: Parallel](xs: GenIterable[T]) = assert(xs == xs.par)
- def assertToPar[K, V](xs: Traversable[(K, V)]) {
+ def assertToPar[K, V](xs: GenTraversable[(K, V)]) {
xs match {
case _: Seq[_] =>
assert(xs.toIterable.par == xs)
@@ -73,7 +78,7 @@ object Test {
assert(xs.par.toMap == xs.toMap)
}
- def assertToParWoMap[T](xs: Seq[T]) {
+ def assertToParWoMap[T](xs: GenSeq[T]) {
assert(xs.toIterable.par == xs.toIterable)
assert(xs.par.toIterable == xs.toIterable)
diff --git a/test/files/run/t4459.scala b/test/files/run/t4459.scala
new file mode 100644
index 0000000000..6e1b871cbe
--- /dev/null
+++ b/test/files/run/t4459.scala
@@ -0,0 +1,12 @@
+import collection._
+
+object Test {
+ def main(args: Array[String]) {
+ for (i <- 0 until 2000) {
+ foo((0 until 10000).toSeq.par)
+ }
+ }
+
+ def foo(arg: GenSeq[_]): String = arg.map(x => x).mkString(",")
+}
+
diff --git a/test/files/scalacheck/HashTrieSplit.scala b/test/files/scalacheck/HashTrieSplit.scala
index 6b20efe12b..e959a3d535 100644
--- a/test/files/scalacheck/HashTrieSplit.scala
+++ b/test/files/scalacheck/HashTrieSplit.scala
@@ -23,8 +23,8 @@ object Test {
// println("created trie")
for (n <- 0 until (sz - 1)) {
// println("---------> n = " + n)
- val pit = ht.parallelIterator
- val pit2 = ht.parallelIterator
+ val pit = ht.splitter
+ val pit2 = ht.splitter
var i = 0
while (i < n) {
pit.next
diff --git a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala
index 744d22f05c..ac3493e56c 100644
--- a/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala
+++ b/test/files/scalacheck/parallel-collections/ParallelIterableCheck.scala
@@ -71,11 +71,11 @@ abstract class ParallelIterableCheck[T](collName: String) extends Properties(col
(inst, fromTraversable(inst), modif)
}
- def areEqual(t1: Traversable[T], t2: Traversable[T]) = if (hasStrictOrder) {
+ def areEqual(t1: GenTraversable[T], t2: GenTraversable[T]) = if (hasStrictOrder) {
t1 == t2 && t2 == t1
} else (t1, t2) match { // it is slightly delicate what `equal` means if the order is not strict
- case (m1: Map[_, _], m2: Map[_, _]) => m1 == m2 && m2 == m1
- case (i1: Iterable[_], i2: Iterable[_]) =>
+ case (m1: GenMap[_, _], m2: GenMap[_, _]) => m1 == m2 && m2 == m1
+ case (i1: GenIterable[_], i2: GenIterable[_]) =>
val i1s = i1.toSet
val i2s = i2.toSet
i1s == i2s && i2s == i1s
diff --git a/test/files/scalacheck/parallel-collections/pc.scala b/test/files/scalacheck/parallel-collections/pc.scala
index 4be7b0ec4d..103b5e2993 100644
--- a/test/files/scalacheck/parallel-collections/pc.scala
+++ b/test/files/scalacheck/parallel-collections/pc.scala
@@ -30,16 +30,6 @@ class ParCollProperties extends Properties("Parallel collections") {
// parallel vectors
include(immutable.IntParallelVectorCheck)
-
- /* Views */
-
- // parallel array views
-
- // parallel immutable hash map views
-
- // parallel mutable hash map views
-
- // parallel vector views
}
diff --git a/test/pending/run/t4283/AbstractFoo.java b/test/pending/run/t4283/AbstractFoo.java
index 6d4e8f4e22..0403271b74 100644
--- a/test/pending/run/t4283/AbstractFoo.java
+++ b/test/pending/run/t4283/AbstractFoo.java
@@ -1,5 +1,6 @@
package test;
/* package private */ class AbstractFoo {
- public int t;
+ public int t = 1;
+ public int f() { return 2; }
} \ No newline at end of file
diff --git a/test/pending/run/t4283/IllegalAccess.scala b/test/pending/run/t4283/IllegalAccess.scala
index e1bce15cf8..12de7e4649 100644
--- a/test/pending/run/t4283/IllegalAccess.scala
+++ b/test/pending/run/t4283/IllegalAccess.scala
@@ -1,5 +1,17 @@
package other
object IllegalAccess {
- val x = (new test.ScalaBipp).make.get.t // java.lang.IllegalAccessError: tried to access class test.AbstractFoo from class other.IllegalAccess$
+ def main(args: Array[String]) {
+ val x = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].f()
+ println(x)
+ val y = (new test.ScalaBipp).make.get.f()
+ println(y)
+ val u = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].t
+ println(u)
+ val v = (new test.ScalaBipp).make.get.t
+ println(v)
+ val sb: test.ScalaBipp = (new test.ScalaBipp).make.get
+ val z = sb.t
+ println(z)
+ }
}
diff --git a/test/scaladoc/resources/Trac4471.scala b/test/scaladoc/resources/Trac4471.scala
new file mode 100644
index 0000000000..2a22887c0d
--- /dev/null
+++ b/test/scaladoc/resources/Trac4471.scala
@@ -0,0 +1,9 @@
+class A {
+ @deprecated def foo = 123
+ @deprecated def bar = 456
+}
+
+class B {
+ def foo = 123
+ @deprecated def bar = 456
+}
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index 15f5249c90..cb31df3fb2 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -24,6 +24,7 @@ object Test extends Properties("HtmlFactory") {
import scala.tools.nsc.doc.{DocFactory, Settings}
import scala.tools.nsc.doc.model.IndexModelFactory
import scala.tools.nsc.doc.html.HtmlFactory
+ import scala.tools.nsc.doc.html.page.ReferenceIndex
def getClasspath = {
// these things can be tricky
@@ -59,6 +60,23 @@ object Test extends Properties("HtmlFactory") {
result
}
+ def createReferenceIndex(basename: String) = {
+ createFactory.makeUniverse(List("test/scaladoc/resources/"+basename)) match {
+ case Some(universe) => {
+ val index = IndexModelFactory.makeIndex(universe)
+ val pages = index.firstLetterIndex.map({
+ case (key, value) => {
+ val page = new ReferenceIndex(key, index, universe)
+ page.absoluteLinkTo(page.path) -> page.body
+ }
+ })
+ Some(pages)
+ }
+ case _ =>
+ None
+ }
+ }
+
def createTemplate(scala: String) = {
val html = scala.stripSuffix(".scala") + ".html"
createTemplates(scala)(html)
@@ -274,4 +292,18 @@ object Test extends Properties("HtmlFactory") {
case _ => false
}
}
+
+ property("Trac #4471") = {
+ createReferenceIndex("Trac4471.scala") match {
+ case Some(pages) =>
+ (pages.get("index/index-f.html") match {
+ case Some(node) => node.toString.contains(">A</a></strike>")
+ case _ => false
+ }) && (pages.get("index/index-b.html") match {
+ case Some(node) => node.toString.contains(">bar</strike>")
+ case _ => false
+ })
+ case _ => false
+ }
+ }
}