Skip to content

Commit dc4e17f

Browse files
committed
Add unit tests for source links existance
1 parent deaebe0 commit dc4e17f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

scaladoc/test-source-links/dotty/tools/scaladoc/source-links/RemoteLinksTest.scala

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,21 @@ import org.junit.Test
1616

1717
class RemoteLinksTest:
1818

19+
Random.setSeed(123L)
20+
val mtslAll = membersToSourceLinks(using testDocContext())
21+
22+
@Test
23+
def scala213XSourceLink =
24+
assertTrue(mtslAll.find((k, _) => k == "AbstractMap").isDefined) // source link to Scala2.13.X stdlib class
25+
26+
@Test
27+
def scala3SourceLink =
28+
assertTrue(mtslAll.find((k, _) => k == "FromDigits").isDefined) // source link to Scala3 stdlib class
29+
1930
@Test
2031
def runTest =
21-
val mtsl = Random.shuffle(membersToSourceLinks(using testDocContext())).take(20) // take 20 random entries. The test is flaky, because of TASTY bug. We should fix it some time.
32+
assertTrue(mtslAll.nonEmpty)
33+
val mtsl = Random.shuffle(mtslAll).take(20) // take 20 random entries
2234
val pageToMtsl: Map[String, List[(String, String)]] = mtsl.groupMap(_._2.split("#L").head)(v => (v._1, v._2.split("#L").last))
2335
pageToMtsl.foreach { case (link, members) =>
2436
try

0 commit comments

Comments
 (0)