diff options
Diffstat (limited to 'compiler/test')
-rw-r--r-- | compiler/test/dotc/scala-collections.blacklist | 351 | ||||
-rw-r--r-- | compiler/test/dotc/tests.scala | 50 |
2 files changed, 395 insertions, 6 deletions
diff --git a/compiler/test/dotc/scala-collections.blacklist b/compiler/test/dotc/scala-collections.blacklist new file mode 100644 index 000000000..7581dd5ba --- /dev/null +++ b/compiler/test/dotc/scala-collections.blacklist @@ -0,0 +1,351 @@ +../scala-scala/src/library/scala/annotation/Annotation.scala +../scala-scala/src/library/scala/annotation/bridge.scala +../scala-scala/src/library/scala/annotation/ClassfileAnnotation.scala +../scala-scala/src/library/scala/annotation/compileTimeOnly.scala +../scala-scala/src/library/scala/annotation/elidable.scala +../scala-scala/src/library/scala/annotation/implicitNotFound.scala +../scala-scala/src/library/scala/annotation/meta/beanGetter.scala +../scala-scala/src/library/scala/annotation/meta/beanSetter.scala +../scala-scala/src/library/scala/annotation/meta/companionClass.scala +../scala-scala/src/library/scala/annotation/meta/companionMethod.scala +../scala-scala/src/library/scala/annotation/meta/companionObject.scala +../scala-scala/src/library/scala/annotation/meta/field.scala +../scala-scala/src/library/scala/annotation/meta/getter.scala +../scala-scala/src/library/scala/annotation/meta/languageFeature.scala +../scala-scala/src/library/scala/annotation/meta/package.scala +../scala-scala/src/library/scala/annotation/meta/param.scala +../scala-scala/src/library/scala/annotation/meta/setter.scala +../scala-scala/src/library/scala/annotation/migration.scala +../scala-scala/src/library/scala/annotation/StaticAnnotation.scala +../scala-scala/src/library/scala/annotation/strictfp.scala +../scala-scala/src/library/scala/annotation/switch.scala +../scala-scala/src/library/scala/annotation/tailrec.scala +../scala-scala/src/library/scala/annotation/TypeConstraint.scala +../scala-scala/src/library/scala/annotation/unchecked/uncheckedStable.scala +../scala-scala/src/library/scala/annotation/unchecked/uncheckedVariance.scala +../scala-scala/src/library/scala/annotation/unspecialized.scala +../scala-scala/src/library/scala/annotation/varargs.scala + +../scala-scala/src/library/scala/AnyVal.scala +../scala-scala/src/library/scala/App.scala + +../scala-scala/src/library/scala/beans/BeanDescription.scala +../scala-scala/src/library/scala/beans/BeanDisplayName.scala +../scala-scala/src/library/scala/beans/BeanInfo.scala +../scala-scala/src/library/scala/beans/BeanInfoSkip.scala +../scala-scala/src/library/scala/beans/BeanProperty.scala +../scala-scala/src/library/scala/beans/BooleanBeanProperty.scala +../scala-scala/src/library/scala/beans/ScalaBeanInfo.scala + +../scala-scala/src/library/scala/collection/concurrent/Map.scala +../scala-scala/src/library/scala/collection/concurrent/TrieMap.scala +../scala-scala/src/library/scala/collection/convert/DecorateAsJava.scala +../scala-scala/src/library/scala/collection/convert/DecorateAsScala.scala +../scala-scala/src/library/scala/collection/convert/Decorators.scala +../scala-scala/src/library/scala/collection/convert/package.scala +../scala-scala/src/library/scala/collection/convert/WrapAsJava.scala +../scala-scala/src/library/scala/collection/convert/WrapAsScala.scala +../scala-scala/src/library/scala/collection/convert/Wrappers.scala + +../scala-scala/src/library/scala/collection/generic/ParSetFactory.scala + +../scala-scala/src/library/scala/collection/mutable/AnyRefMap.scala +../scala-scala/src/library/scala/collection/mutable/ArrayBuffer.scala +../scala-scala/src/library/scala/collection/mutable/ArrayLike.scala +../scala-scala/src/library/scala/collection/mutable/ArrayOps.scala +../scala-scala/src/library/scala/collection/mutable/ArraySeq.scala +../scala-scala/src/library/scala/collection/mutable/ArrayStack.scala +../scala-scala/src/library/scala/collection/mutable/AVLTree.scala +../scala-scala/src/library/scala/collection/mutable/BitSet.scala +../scala-scala/src/library/scala/collection/mutable/Buffer.scala +../scala-scala/src/library/scala/collection/mutable/BufferProxy.scala +../scala-scala/src/library/scala/collection/mutable/Cloneable.scala +../scala-scala/src/library/scala/collection/mutable/DefaultEntry.scala +../scala-scala/src/library/scala/collection/mutable/DefaultMapModel.scala +../scala-scala/src/library/scala/collection/mutable/DoubleLinkedList.scala +../scala-scala/src/library/scala/collection/mutable/DoubleLinkedListLike.scala +../scala-scala/src/library/scala/collection/mutable/FlatHashTable.scala +../scala-scala/src/library/scala/collection/mutable/HashEntry.scala +../scala-scala/src/library/scala/collection/mutable/HashMap.scala +../scala-scala/src/library/scala/collection/mutable/HashSet.scala +../scala-scala/src/library/scala/collection/mutable/HashTable.scala +../scala-scala/src/library/scala/collection/mutable/History.scala +../scala-scala/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala +../scala-scala/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala +../scala-scala/src/library/scala/collection/mutable/IndexedSeqLike.scala +../scala-scala/src/library/scala/collection/mutable/IndexedSeqOptimized.scala +../scala-scala/src/library/scala/collection/mutable/Iterable.scala +../scala-scala/src/library/scala/collection/mutable/LazyBuilder.scala +../scala-scala/src/library/scala/collection/mutable/LinearSeq.scala +../scala-scala/src/library/scala/collection/mutable/LinkedEntry.scala +../scala-scala/src/library/scala/collection/mutable/LinkedHashMap.scala +../scala-scala/src/library/scala/collection/mutable/LinkedHashSet.scala +../scala-scala/src/library/scala/collection/mutable/LinkedList.scala +../scala-scala/src/library/scala/collection/mutable/LinkedListLike.scala +../scala-scala/src/library/scala/collection/mutable/ListMap.scala +../scala-scala/src/library/scala/collection/mutable/LongMap.scala +../scala-scala/src/library/scala/collection/mutable/Map.scala +../scala-scala/src/library/scala/collection/mutable/MapBuilder.scala +../scala-scala/src/library/scala/collection/mutable/MapLike.scala +../scala-scala/src/library/scala/collection/mutable/MapProxy.scala +../scala-scala/src/library/scala/collection/mutable/MultiMap.scala +../scala-scala/src/library/scala/collection/mutable/MutableList.scala +../scala-scala/src/library/scala/collection/mutable/ObservableBuffer.scala +../scala-scala/src/library/scala/collection/mutable/ObservableMap.scala +../scala-scala/src/library/scala/collection/mutable/ObservableSet.scala +../scala-scala/src/library/scala/collection/mutable/OpenHashMap.scala +../scala-scala/src/library/scala/collection/mutable/PriorityQueue.scala +../scala-scala/src/library/scala/collection/mutable/PriorityQueueProxy.scala +../scala-scala/src/library/scala/collection/mutable/Publisher.scala +../scala-scala/src/library/scala/collection/mutable/Queue.scala +../scala-scala/src/library/scala/collection/mutable/QueueProxy.scala +../scala-scala/src/library/scala/collection/mutable/ResizableArray.scala +../scala-scala/src/library/scala/collection/mutable/RevertibleHistory.scala +../scala-scala/src/library/scala/collection/mutable/Seq.scala +../scala-scala/src/library/scala/collection/mutable/SeqLike.scala +../scala-scala/src/library/scala/collection/mutable/Set.scala +../scala-scala/src/library/scala/collection/mutable/SetBuilder.scala +../scala-scala/src/library/scala/collection/mutable/SetLike.scala +../scala-scala/src/library/scala/collection/mutable/SetProxy.scala +../scala-scala/src/library/scala/collection/mutable/SortedSet.scala +../scala-scala/src/library/scala/collection/mutable/Stack.scala +../scala-scala/src/library/scala/collection/mutable/StackProxy.scala +../scala-scala/src/library/scala/collection/mutable/StringBuilder.scala +../scala-scala/src/library/scala/collection/mutable/Subscriber.scala +../scala-scala/src/library/scala/collection/mutable/SynchronizedBuffer.scala +../scala-scala/src/library/scala/collection/mutable/SynchronizedMap.scala +../scala-scala/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala +../scala-scala/src/library/scala/collection/mutable/SynchronizedQueue.scala +../scala-scala/src/library/scala/collection/mutable/SynchronizedSet.scala +../scala-scala/src/library/scala/collection/mutable/SynchronizedStack.scala +../scala-scala/src/library/scala/collection/mutable/Traversable.scala +../scala-scala/src/library/scala/collection/mutable/TreeSet.scala +../scala-scala/src/library/scala/collection/mutable/Undoable.scala +../scala-scala/src/library/scala/collection/mutable/UnrolledBuffer.scala +../scala-scala/src/library/scala/collection/mutable/WeakHashMap.scala + +../scala-scala/src/library/scala/collection/parallel/Combiner.scala +../scala-scala/src/library/scala/collection/parallel/immutable/package.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParHashMap.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParHashSet.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParIterable.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParMap.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParRange.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParSeq.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParSet.scala +../scala-scala/src/library/scala/collection/parallel/immutable/ParVector.scala +../scala-scala/src/library/scala/collection/parallel/mutable/LazyCombiner.scala +../scala-scala/src/library/scala/collection/parallel/mutable/package.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParArray.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParFlatHashTable.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParHashMap.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParHashSet.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParHashTable.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParIterable.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParMap.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParMapLike.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParSeq.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParSet.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ParTrieMap.scala +../scala-scala/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala +../scala-scala/src/library/scala/collection/parallel/mutable/UnrolledParArrayCombiner.scala +../scala-scala/src/library/scala/collection/parallel/package.scala +../scala-scala/src/library/scala/collection/parallel/ParIterable.scala +../scala-scala/src/library/scala/collection/parallel/ParIterableLike.scala +../scala-scala/src/library/scala/collection/parallel/ParMap.scala +../scala-scala/src/library/scala/collection/parallel/ParMapLike.scala +../scala-scala/src/library/scala/collection/parallel/ParSeq.scala +../scala-scala/src/library/scala/collection/parallel/ParSeqLike.scala +../scala-scala/src/library/scala/collection/parallel/ParSet.scala +../scala-scala/src/library/scala/collection/parallel/ParSetLike.scala +../scala-scala/src/library/scala/collection/parallel/PreciseSplitter.scala +../scala-scala/src/library/scala/collection/parallel/RemainsIterator.scala +../scala-scala/src/library/scala/collection/parallel/Splitter.scala +../scala-scala/src/library/scala/collection/parallel/Tasks.scala +../scala-scala/src/library/scala/collection/parallel/TaskSupport.scala + +../scala-scala/src/library/scala/collection/script/Location.scala +../scala-scala/src/library/scala/collection/script/Message.scala +../scala-scala/src/library/scala/collection/script/Scriptable.scala + +../scala-scala/src/library/scala/compat/Platform.scala + +../scala-scala/src/library/scala/concurrent/Awaitable.scala +../scala-scala/src/library/scala/concurrent/BatchingExecutor.scala +../scala-scala/src/library/scala/concurrent/BlockContext.scala +../scala-scala/src/library/scala/concurrent/Channel.scala +../scala-scala/src/library/scala/concurrent/DelayedLazyVal.scala +../scala-scala/src/library/scala/concurrent/duration/Deadline.scala +../scala-scala/src/library/scala/concurrent/duration/Duration.scala +../scala-scala/src/library/scala/concurrent/duration/DurationConversions.scala +../scala-scala/src/library/scala/concurrent/duration/package.scala +../scala-scala/src/library/scala/concurrent/ExecutionContext.scala +../scala-scala/src/library/scala/concurrent/Future.scala +../scala-scala/src/library/scala/concurrent/FutureTaskRunner.scala +../scala-scala/src/library/scala/concurrent/impl/ExecutionContextImpl.scala +../scala-scala/src/library/scala/concurrent/impl/Future.scala +../scala-scala/src/library/scala/concurrent/impl/Promise.scala +../scala-scala/src/library/scala/concurrent/JavaConversions.scala +../scala-scala/src/library/scala/concurrent/Lock.scala +../scala-scala/src/library/scala/concurrent/ManagedBlocker.scala +../scala-scala/src/library/scala/concurrent/package.scala +../scala-scala/src/library/scala/concurrent/Promise.scala +../scala-scala/src/library/scala/concurrent/SyncChannel.scala +../scala-scala/src/library/scala/concurrent/SyncVar.scala +../scala-scala/src/library/scala/concurrent/TaskRunner.scala +../scala-scala/src/library/scala/concurrent/ThreadPoolRunner.scala + +../scala-scala/src/library/scala/Console.scala +../scala-scala/src/library/scala/Enumeration.scala +../scala-scala/src/library/scala/Function.scala +../scala-scala/src/library/scala/Function0.scala +../scala-scala/src/library/scala/Function1.scala +../scala-scala/src/library/scala/Function10.scala +../scala-scala/src/library/scala/Function11.scala +../scala-scala/src/library/scala/Function12.scala +../scala-scala/src/library/scala/Function13.scala +../scala-scala/src/library/scala/Function14.scala +../scala-scala/src/library/scala/Function15.scala +../scala-scala/src/library/scala/Function16.scala +../scala-scala/src/library/scala/Function17.scala +../scala-scala/src/library/scala/Function18.scala +../scala-scala/src/library/scala/Function19.scala +../scala-scala/src/library/scala/Function2.scala +../scala-scala/src/library/scala/Function20.scala +../scala-scala/src/library/scala/Function21.scala +../scala-scala/src/library/scala/Function22.scala +../scala-scala/src/library/scala/Function3.scala +../scala-scala/src/library/scala/Function4.scala +../scala-scala/src/library/scala/Function5.scala +../scala-scala/src/library/scala/Function6.scala +../scala-scala/src/library/scala/Function7.scala +../scala-scala/src/library/scala/Function8.scala +../scala-scala/src/library/scala/Function9.scala + +../scala-scala/src/library/scala/io/AnsiColor.scala +../scala-scala/src/library/scala/io/BufferedSource.scala +../scala-scala/src/library/scala/io/Codec.scala +../scala-scala/src/library/scala/io/Position.scala +../scala-scala/src/library/scala/io/Source.scala +../scala-scala/src/library/scala/io/StdIn.scala + +../scala-scala/src/library/scala/math/BigDecimal.scala +../scala-scala/src/library/scala/math/BigInt.scala +../scala-scala/src/library/scala/math/PartiallyOrdered.scala + +../scala-scala/src/library/scala/ref/PhantomReference.scala +../scala-scala/src/library/scala/ref/Reference.scala +../scala-scala/src/library/scala/ref/ReferenceQueue.scala +../scala-scala/src/library/scala/ref/ReferenceWrapper.scala +../scala-scala/src/library/scala/ref/SoftReference.scala +../scala-scala/src/library/scala/ref/WeakReference.scala + +../scala-scala/src/library/scala/reflect/ClassManifestDeprecatedApis.scala +../scala-scala/src/library/scala/reflect/ClassTag.scala +../scala-scala/src/library/scala/reflect/macros/internal/macroImpl.scala +../scala-scala/src/library/scala/reflect/Manifest.scala +../scala-scala/src/library/scala/reflect/NameTransformer.scala +../scala-scala/src/library/scala/reflect/NoManifest.scala +../scala-scala/src/library/scala/reflect/OptManifest.scala +../scala-scala/src/library/scala/reflect/package.scala + +../scala-scala/src/library/scala/Responder.scala + +../scala-scala/src/library/scala/runtime/AbstractFunction0.scala +../scala-scala/src/library/scala/runtime/AbstractFunction1.scala +../scala-scala/src/library/scala/runtime/AbstractFunction10.scala +../scala-scala/src/library/scala/runtime/AbstractFunction11.scala +../scala-scala/src/library/scala/runtime/AbstractFunction12.scala +../scala-scala/src/library/scala/runtime/AbstractFunction13.scala +../scala-scala/src/library/scala/runtime/AbstractFunction14.scala +../scala-scala/src/library/scala/runtime/AbstractFunction15.scala +../scala-scala/src/library/scala/runtime/AbstractFunction16.scala +../scala-scala/src/library/scala/runtime/AbstractFunction17.scala +../scala-scala/src/library/scala/runtime/AbstractFunction18.scala +../scala-scala/src/library/scala/runtime/AbstractFunction19.scala +../scala-scala/src/library/scala/runtime/AbstractFunction2.scala +../scala-scala/src/library/scala/runtime/AbstractFunction20.scala +../scala-scala/src/library/scala/runtime/AbstractFunction21.scala +../scala-scala/src/library/scala/runtime/AbstractFunction22.scala +../scala-scala/src/library/scala/runtime/AbstractFunction3.scala +../scala-scala/src/library/scala/runtime/AbstractFunction4.scala +../scala-scala/src/library/scala/runtime/AbstractFunction5.scala +../scala-scala/src/library/scala/runtime/AbstractFunction6.scala +../scala-scala/src/library/scala/runtime/AbstractFunction7.scala +../scala-scala/src/library/scala/runtime/AbstractFunction8.scala +../scala-scala/src/library/scala/runtime/AbstractFunction9.scala +../scala-scala/src/library/scala/runtime/AbstractPartialFunction.scala +../scala-scala/src/library/scala/runtime/Boxed.scala +../scala-scala/src/library/scala/runtime/MethodCache.scala +../scala-scala/src/library/scala/runtime/NonLocalReturnControl.scala +../scala-scala/src/library/scala/runtime/Nothing$.scala +../scala-scala/src/library/scala/runtime/Null$.scala +../scala-scala/src/library/scala/runtime/package.scala +../scala-scala/src/library/scala/runtime/ScalaNumberProxy.scala +../scala-scala/src/library/scala/runtime/ScalaRunTime.scala +../scala-scala/src/library/scala/runtime/SeqCharSequence.scala +../scala-scala/src/library/scala/runtime/StringAdd.scala +../scala-scala/src/library/scala/runtime/StringFormat.scala +../scala-scala/src/library/scala/runtime/Tuple2Zipped.scala +../scala-scala/src/library/scala/runtime/Tuple3Zipped.scala + +../scala-scala/src/library/scala/StringContext.scala + +../scala-scala/src/library/scala/sys/BooleanProp.scala +../scala-scala/src/library/scala/sys/package.scala +../scala-scala/src/library/scala/sys/process/BasicIO.scala +../scala-scala/src/library/scala/sys/process/package.scala +../scala-scala/src/library/scala/sys/process/Process.scala +../scala-scala/src/library/scala/sys/process/ProcessBuilder.scala +../scala-scala/src/library/scala/sys/process/ProcessBuilderImpl.scala +../scala-scala/src/library/scala/sys/process/ProcessImpl.scala +../scala-scala/src/library/scala/sys/process/ProcessIO.scala +../scala-scala/src/library/scala/sys/process/ProcessLogger.scala +../scala-scala/src/library/scala/sys/Prop.scala +../scala-scala/src/library/scala/sys/PropImpl.scala +../scala-scala/src/library/scala/sys/ShutdownHookThread.scala +../scala-scala/src/library/scala/sys/SystemProperties.scala + +../scala-scala/src/library/scala/text/Document.scala + +../scala-scala/src/library/scala/Tuple1.scala +../scala-scala/src/library/scala/Tuple10.scala +../scala-scala/src/library/scala/Tuple11.scala +../scala-scala/src/library/scala/Tuple12.scala +../scala-scala/src/library/scala/Tuple13.scala +../scala-scala/src/library/scala/Tuple14.scala +../scala-scala/src/library/scala/Tuple15.scala +../scala-scala/src/library/scala/Tuple16.scala +../scala-scala/src/library/scala/Tuple17.scala +../scala-scala/src/library/scala/Tuple18.scala +../scala-scala/src/library/scala/Tuple19.scala +../scala-scala/src/library/scala/Tuple2.scala +../scala-scala/src/library/scala/Tuple20.scala +../scala-scala/src/library/scala/Tuple21.scala +../scala-scala/src/library/scala/Tuple22.scala +../scala-scala/src/library/scala/Tuple3.scala +../scala-scala/src/library/scala/Tuple4.scala +../scala-scala/src/library/scala/Tuple5.scala +../scala-scala/src/library/scala/Tuple6.scala +../scala-scala/src/library/scala/Tuple7.scala +../scala-scala/src/library/scala/Tuple8.scala +../scala-scala/src/library/scala/Tuple9.scala + +../scala-scala/src/library/scala/util/control/Breaks.scala +../scala-scala/src/library/scala/util/control/ControlThrowable.scala +../scala-scala/src/library/scala/util/control/Exception.scala +../scala-scala/src/library/scala/util/control/NonFatal.scala +../scala-scala/src/library/scala/util/control/NoStackTrace.scala +../scala-scala/src/library/scala/util/control/TailCalls.scala +../scala-scala/src/library/scala/util/DynamicVariable.scala +../scala-scala/src/library/scala/util/Either.scala +../scala-scala/src/library/scala/util/hashing/ByteswapHashing.scala +../scala-scala/src/library/scala/util/hashing/Hashing.scala +../scala-scala/src/library/scala/util/hashing/MurmurHash3.scala +../scala-scala/src/library/scala/util/hashing/package.scala +../scala-scala/src/library/scala/util/matching/Regex.scala +../scala-scala/src/library/scala/util/MurmurHash.scala +../scala-scala/src/library/scala/util/Properties.scala +../scala-scala/src/library/scala/util/Random.scala +../scala-scala/src/library/scala/util/Sorting.scala diff --git a/compiler/test/dotc/tests.scala b/compiler/test/dotc/tests.scala index f858926d5..84cf1a051 100644 --- a/compiler/test/dotc/tests.scala +++ b/compiler/test/dotc/tests.scala @@ -3,6 +3,7 @@ package dotc import dotty.Jars import dotty.tools.dotc.CompilerTest import org.junit.{Before, Test} +import org.junit.Assert._ import java.io.{ File => JFile } import scala.reflect.io.Directory @@ -197,12 +198,49 @@ class tests extends CompilerTest { @Test def run_all = runFiles(runDir) - val stdlibFiles = Source.fromFile("./test/dotc/scala-collections.whitelist", "UTF8").getLines() - .map(_.trim) // allow identation - .filter(!_.startsWith("#")) // allow comment lines prefixed by # - .map(_.takeWhile(_ != '#').trim) // allow comments in the end of line - .filter(_.nonEmpty) - .toList + def loadList(path: String) = Source.fromFile(path, "UTF8").getLines() + .map(_.trim) // allow identation + .filter(!_.startsWith("#")) // allow comment lines prefixed by # + .map(_.takeWhile(_ != '#').trim) // allow comments in the end of line + .filter(_.nonEmpty) + .toList + + private def stdlibWhitelistFile = "./test/dotc/scala-collections.whitelist" + private def stdlibBlackFile = "./test/dotc/scala-collections.blacklist" + + private val stdlibFiles: List[String] = loadList(stdlibWhitelistFile) + + @Test def checkWBLists = { + val stdlibFilesBlackListed = loadList(stdlibBlackFile) + + def checkForRepeated(list: List[String], listFile: String) = { + val duplicates = list.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 $listFile:\n", "\n", "\n") + assertTrue(msg, duplicates.isEmpty) + } + checkForRepeated(stdlibFiles, stdlibWhitelistFile) + checkForRepeated(stdlibFilesBlackListed, stdlibBlackFile) + + val whitelistSet = stdlibFiles.toSet + val blacklistSet = stdlibFilesBlackListed.toSet + + val intersection = whitelistSet.intersect(blacklistSet) + val msgIntersection = + intersection.map(x => s"'$x'").mkString(s"Entries where found in both $stdlibWhitelistFile and $stdlibBlackFile:\n", "\n", "\n") + assertTrue(msgIntersection, intersection.isEmpty) + + def collectAllFilesInDir(dir: JFile, acc: List[String]): List[String] = { + val files = dir.listFiles() + val acc2 = files.foldLeft(acc)((acc1, file) => if (file.isFile && file.getPath.endsWith(".scala")) file.getPath :: acc1 else acc1) + files.foldLeft(acc2)((acc3, file) => if (file.isDirectory) collectAllFilesInDir(file, acc3) else acc3) + } + val filesInStdLib = collectAllFilesInDir(new JFile("../scala-scala/src/library/"), Nil) + val missingFiles = filesInStdLib.toSet -- whitelistSet -- blacklistSet + val msgMissing = + missingFiles.map(x => s"'$x'").mkString(s"Entries are missing in $stdlibWhitelistFile or $stdlibBlackFile:\n", "\n", "\n") + assertTrue(msgMissing, missingFiles.isEmpty) + } + @Test def compileStdLib = compileList("compileStdLib", stdlibFiles, "-migration" :: "-Yno-inline" :: scala2mode) @Test def compileMixed = compileLine( |