summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2016-03-23 08:46:32 +0100
committerLukas Rytz <lukas.rytz@typesafe.com>2016-03-23 08:46:32 +0100
commit952da60a5be15ef972b521bdaf5e650f7e0a5245 (patch)
tree41a5f0589f1cc2fa1caba7ca0265782fa0e151fd /test
parent6dbdb09711140c8022a8721c520dd08661bb1fb2 (diff)
parentf8950c1457955835f4411beb8dcb3672f7cd39bd (diff)
downloadscala-952da60a5be15ef972b521bdaf5e650f7e0a5245.tar.gz
scala-952da60a5be15ef972b521bdaf5e650f7e0a5245.tar.bz2
scala-952da60a5be15ef972b521bdaf5e650f7e0a5245.zip
Merge pull request #5057 from lrytz/flatClasspath
Enable -YclasspathImpl:flat by default
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t6502.scala45
-rw-r--r--test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala6
2 files changed, 23 insertions, 28 deletions
diff --git a/test/files/run/t6502.scala b/test/files/run/t6502.scala
index f4fc39a03d..dffb0e2f98 100644
--- a/test/files/run/t6502.scala
+++ b/test/files/run/t6502.scala
@@ -14,11 +14,11 @@ object Test extends StoreReporterDirectTest {
compileString(newCompiler("-cp", classpath, "-d", s"${testOutput.path}/$jarFileName"))(code)
}
- // TODO flat classpath doesn't support the classpath invalidation yet so we force using the recursive one
- // it's the only test which needed such a workaround
+ var classPathKind: String = ""
+
override def settings = {
val settings = new Settings
- settings.YclasspathImpl.value = ClassPathRepresentationType.Recursive
+ settings.YclasspathImpl.value = classPathKind
settings
}
@@ -72,9 +72,8 @@ object Test extends StoreReporterDirectTest {
s"[${added}] in [${output.lines.mkString("/")}]"
)
lines = lines drop promptLength
- assert {
- lines.next.contains("testing...")
- }
+ val r = lines.next
+ assert(r.contains("testing..."), r)
}
def test2(): Unit = {
@@ -91,14 +90,10 @@ object Test extends StoreReporterDirectTest {
var lines = output.lines.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
- assert {
- added.contains("Added") && added.contains("test1.jar")
- }
+ assert(added.contains("Added") && added.contains("test1.jar"), added)
lines = lines drop promptLength
val msg = lines.next
- assert {
- msg.contains("test2.jar") && msg.contains("existing classpath entries conflict")
- }
+ assert(msg.contains("test2.jar") && msg.contains("contains a classfile that already exists on the classpath: test.Test$"), msg)
}
def test3(): Unit = {
@@ -116,13 +111,10 @@ object Test extends StoreReporterDirectTest {
var lines = output.lines.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
- assert {
- added.contains("Added") && added.contains("test1.jar")
- }
+ assert(added.contains("Added") && added.contains("test1.jar"), added)
lines = lines drop (2 * promptLength + 1)
- assert {
- lines.next.contains("new object in existing package")
- }
+ val r = lines.next
+ assert(r.contains("new object in existing package"), r)
}
def test4(): Unit = {
@@ -136,14 +128,10 @@ object Test extends StoreReporterDirectTest {
var lines = output.lines.drop(headerLength)
lines = lines drop promptLength
val added = lines.next
- assert {
- added.contains("Added") && added.contains("test1.jar")
- }
+ assert(added.contains("Added") && added.contains("test1.jar"), added)
lines = lines drop promptLength
val msg = lines.next
- assert {
- msg.contains("test1.jar") && msg.contains("existing classpath entries conflict")
- }
+ assert(msg.contains("test1.jar") && msg.contains("contains a classfile that already exists on the classpath: test.Test$"), msg)
}
def test5(): Unit = {
@@ -167,7 +155,7 @@ object Test extends StoreReporterDirectTest {
assert(output.contains("created test6.Z"), output)
}
- def show(): Unit = {
+ def testAll(): Unit = {
test1()
test2()
test3()
@@ -175,4 +163,11 @@ object Test extends StoreReporterDirectTest {
test5()
test6()
}
+
+ def show(): Unit = {
+ classPathKind = ClassPathRepresentationType.Flat
+ testAll()
+ classPathKind = ClassPathRepresentationType.Recursive
+ testAll()
+ }
}
diff --git a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
index 365901c4d6..812c298c48 100644
--- a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
+++ b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
@@ -2,12 +2,12 @@ package scala.tools.nsc
package symtab
import scala.reflect.ClassTag
-import scala.reflect.internal.{Phase, NoPhase, SomePhase}
+import scala.reflect.internal.{NoPhase, Phase, SomePhase}
import scala.tools.nsc.classpath.FlatClassPath
import scala.tools.nsc.settings.ClassPathRepresentationType
import scala.tools.util.FlatClassPathResolver
import scala.tools.util.PathResolver
-import util.ClassPath
+import util.{ClassFileLookup, ClassPath}
import io.AbstractFile
/**
@@ -54,7 +54,7 @@ class SymbolTableForUnitTesting extends SymbolTable {
def isMaybeBoxed(sym: Symbol): Boolean = ???
def needCompile(bin: AbstractFile, src: AbstractFile): Boolean = ???
def externalEquals: Symbol = ???
- def updateClassPath(subst: Map[ClassPath[AbstractFile], ClassPath[AbstractFile]]): Unit = ???
+ def updateClassPath(subst: Map[ClassFileLookup[AbstractFile], ClassFileLookup[AbstractFile]]): Unit = ???
}
object loaders extends symtab.SymbolLoaders {