@@ -7,26 +7,11 @@ import org.junit.Assert._
7
7
8
8
object StdLibSources {
9
9
10
- /* For debug only */
11
- private val useExplicitWhiteList = false
12
-
13
10
private final val stdLibPath = " scala2-library/src/library/"
14
11
15
12
def blacklistFile : String = " compiler/test/dotc/scala-collections.blacklist"
16
- private def whitelistFile : String = " compiler/test/dotc/scala-collections.whitelist"
17
-
18
- def whitelisted : List [String ] = {
19
- lazy val whitelistBasedOnBlacklist = all.diff(blacklisted)
20
- if (! useExplicitWhiteList) {
21
- whitelistBasedOnBlacklist
22
- } else if (! new File (whitelistFile).exists()) {
23
- genWhitelist(whitelistBasedOnBlacklist.map(_.replace(stdLibPath, " " )))
24
- whitelistBasedOnBlacklist
25
- } else {
26
- loadList(whitelistFile)
27
- }
28
- }
29
13
14
+ def whitelisted : List [String ] = all.diff(blacklisted)
30
15
def blacklisted : List [String ] = loadList(blacklistFile)
31
16
32
17
def all : List [String ] = {
@@ -38,17 +23,6 @@ object StdLibSources {
38
23
collectAllFilesInDir(new File (stdLibPath), Nil )
39
24
}
40
25
41
- private def genWhitelist (list : List [String ]): Unit = {
42
- println(s " Generating $whitelistFile based on $blacklistFile" )
43
- val whitelist = new File (whitelistFile)
44
- val p = new java.io.PrintWriter (whitelist)
45
- try {
46
- list.foreach(p.println)
47
- } finally {
48
- p.close()
49
- }
50
- }
51
-
52
26
private def loadList (path : String ): List [String ] = Source .fromFile(path, " UTF8" ).getLines()
53
27
.map(_.trim) // allow identation
54
28
.filter(! _.startsWith(" #" )) // allow comment lines prefixed by #
@@ -58,17 +32,3 @@ object StdLibSources {
58
32
.toList
59
33
60
34
}
61
-
62
- class StdLibSources {
63
- @ Test def checkWBLists = {
64
- val stdlibFilesBlackListed = StdLibSources .blacklisted
65
-
66
- val duplicates = stdlibFilesBlackListed.groupBy(x => x).filter(_._2.size > 1 ).filter(_._2.size > 1 )
67
- val msg = duplicates.map(x => s " ' ${x._1}' appears ${x._2.size} times " ).mkString(s " Duplicate entries in ${StdLibSources .blacklistFile}: \n " , " \n " , " \n " )
68
- assertTrue(msg, duplicates.isEmpty)
69
-
70
- val filesNotInStdLib = stdlibFilesBlackListed.toSet -- StdLibSources .all
71
- val msg2 = filesNotInStdLib.map(x => s " ' $x' " ).mkString(s " Entries in ${StdLibSources .blacklistFile} where not found: \n " , " \n " , " \n " )
72
- assertTrue(msg2, filesNotInStdLib.isEmpty)
73
- }
74
- }
0 commit comments