@@ -36,16 +36,23 @@ class RemoteLinksTest:
36
36
@ Test
37
37
def runTest =
38
38
assertTrue(mtslAll.nonEmpty)
39
- val mtsl = randomGenerator.shuffle(mtslAll).take(20 ) // take 20 random entries
39
+ val mtsl = randomGenerator.shuffle(mtslAll.filter(_._1 != " Predef " ) ).take(20 ) // take 20 random entries
40
40
val pageToMtsl : Map [String , List [(String , String )]] = mtsl.groupMap(_._2.split(" #L" ).head)(v => (v._1, v._2.split(" #L" ).last))
41
41
pageToMtsl.foreach { case (link, members) =>
42
42
try
43
43
val doc = getDocumentFromUrl(link)
44
- members.foreach { (member, line) =>
44
+ println(s " Checking $link" )
45
+ members.foreach { case (member, expectedLine) =>
45
46
if ! member.startsWith(" given_" ) then // TODO: handle synthetic givens, for now we disable them from testing
46
- val loc = doc.select( s " #LC $line " ).text
47
+ val toLine = expectedLine + 3
47
48
val memberToMatch = member.replace(" `" , " " )
48
- assertTrue(s " Expected to find $memberToMatch at $link at line $line" , loc.contains(memberToMatch))
49
+ val lineCorrectlyDefined = (expectedLine.toInt until toLine.toInt).exists{ line =>
50
+ val loc = doc.select(s " #LC $line" ).text
51
+
52
+ loc.contains(memberToMatch)
53
+ }
54
+
55
+ assertTrue(s " Expected to find $memberToMatch at $link at lines $expectedLine- $toLine" , lineCorrectlyDefined)
49
56
}
50
57
catch
51
58
case e : java.lang.IllegalArgumentException =>
0 commit comments