Skip to content

Commit 7c2a61c

Browse files
committed
Add back whitelisted list
1 parent b510c6a commit 7c2a61c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/test/dotty/tools/StdLibSources.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,18 @@ object StdLibSources {
1111

1212
def blacklistFile: String = "compiler/test/dotc/scala-collections.blacklist"
1313

14+
def whitelisted: List[String] = all.diff(blacklisted)
1415
def blacklisted: List[String] = loadList(blacklistFile)
1516

17+
def all: List[String] = {
18+
def collectAllFilesInDir(dir: File, acc: List[String]): List[String] = {
19+
val files = dir.listFiles()
20+
val acc2 = files.foldLeft(acc)((acc1, file) => if (file.isFile && file.getPath.endsWith(".scala")) file.getPath :: acc1 else acc1)
21+
files.foldLeft(acc2)((acc3, file) => if (file.isDirectory) collectAllFilesInDir(file, acc3) else acc3)
22+
}
23+
collectAllFilesInDir(new File(stdLibPath), Nil)
24+
}
25+
1626
private def loadList(path: String): List[String] = Source.fromFile(path, "UTF8").getLines()
1727
.map(_.trim) // allow identation
1828
.filter(!_.startsWith("#")) // allow comment lines prefixed by #

0 commit comments

Comments
 (0)