Skip to content

Fix bugs in RemoteLinksTests #13200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ class RemoteLinksTest:
def runTest =
assertTrue(mtslAll.nonEmpty)
val mtsl = randomGenerator.shuffle(mtslAll).take(80) // take 80 random entries
val pageToMtsl: Map[String, List[(String, String)]] = mtsl.groupMap(_._2.split("#L").head)(v => (v._1, v._2.split("#L").last))
pageToMtsl.foreach { case (link, members) =>
val pageToMtsl: Map[String, List[(String, Int)]] =
mtsl.groupMap(_._2.split("#L").head)(v => (v._1, v._2.split("#L").last.toInt))
pageToMtsl.toSeq.sortBy(_._1).foreach { case (link, members) =>
try
val doc = getDocumentFromUrl(link)
println(s"Checking $link")
members.foreach { case (member, expectedLine) =>
if !member.startsWith("given_") then // TODO: handle synthetic givens, for now we disable them from testing
val toLine = expectedLine + 3
val memberToMatch = member.replace("`", "")
val lineCorrectlyDefined = (expectedLine.toInt until toLine.toInt).exists{ line =>
val lineCorrectlyDefined = (expectedLine until toLine).exists{ line =>
val loc = doc.select(s"#LC$line").text

loc.contains(memberToMatch)
Expand Down