From c0a76af4f3434c0e6527d56e636b446bfd5598bb Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 16 Mar 2017 16:38:37 +0100 Subject: Move whitelist test out of `tests.scala` --- compiler/test/dotty/tools/StdLibSources.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'compiler/test/dotty/tools/StdLibSources.scala') diff --git a/compiler/test/dotty/tools/StdLibSources.scala b/compiler/test/dotty/tools/StdLibSources.scala index e3da36f22..24ca9b80b 100644 --- a/compiler/test/dotty/tools/StdLibSources.scala +++ b/compiler/test/dotty/tools/StdLibSources.scala @@ -57,3 +57,20 @@ object StdLibSources { .toList } + +class StdLibSources { + import org.junit.Test + import org.junit.Assert._ + + @Test def checkWBLists = { + val stdlibFilesBlackListed = StdLibSources.blacklisted + + val duplicates = stdlibFilesBlackListed.groupBy(x => x).filter(_._2.size > 1).filter(_._2.size > 1) + val msg = duplicates.map(x => s"'${x._1}' appears ${x._2.size} times").mkString(s"Duplicate entries in ${StdLibSources.blacklistFile}:\n", "\n", "\n") + assertTrue(msg, duplicates.isEmpty) + + val filesNotInStdLib = stdlibFilesBlackListed.toSet -- StdLibSources.all + val msg2 = filesNotInStdLib.map(x => s"'$x'").mkString(s"Entries in ${StdLibSources.blacklistFile} where not found:\n", "\n", "\n") + assertTrue(msg2, filesNotInStdLib.isEmpty) + } +} -- cgit v1.2.3