summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/interpolation.scala2
-rw-r--r--test/files/run/interpolationMultiline1.scala2
-rw-r--r--test/files/run/t5527.check2
-rw-r--r--test/files/run/t5603.check2
-rw-r--r--test/files/run/t6028.check2
-rw-r--r--test/files/run/t6288.check2
-rw-r--r--test/files/run/t6440.check2
-rw-r--r--test/files/run/t6555.check2
-rw-r--r--test/files/run/t7271.check12
-rw-r--r--test/files/run/t7271.scala34
-rw-r--r--test/files/run/t7325.check19
-rw-r--r--test/files/run/t7325.scala25
-rw-r--r--test/files/run/t7398.scala31
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_lookup.check2
-rw-r--r--test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check2
15 files changed, 131 insertions, 10 deletions
diff --git a/test/files/run/interpolation.scala b/test/files/run/interpolation.scala
index f443bd5feb..14d9819348 100644
--- a/test/files/run/interpolation.scala
+++ b/test/files/run/interpolation.scala
@@ -13,7 +13,7 @@ object Test extends App {
println(s"Best price: $f")
println(f"Best price: $f%.2f")
println(s"$f% discount included")
- println(f"$f%3.2f% discount included")
+ println(f"$f%3.2f%% discount included")
}
test1(1)
diff --git a/test/files/run/interpolationMultiline1.scala b/test/files/run/interpolationMultiline1.scala
index 437aed44b0..db634e7775 100644
--- a/test/files/run/interpolationMultiline1.scala
+++ b/test/files/run/interpolationMultiline1.scala
@@ -13,7 +13,7 @@ object Test extends App {
println(s"""Best price: $f""")
println(f"""Best price: $f%.2f""")
println(s"""$f% discount included""")
- println(f"""$f%3.2f% discount included""")
+ println(f"""$f%3.2f%% discount included""")
}
test1(1)
diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check
index 1518168c51..36bee9bb55 100644
--- a/test/files/run/t5527.check
+++ b/test/files/run/t5527.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of parser]] // newSource1
+[[syntax trees at end of parser]] // newSource1.scala
package <empty> {
object UselessComments extends scala.AnyRef {
def <init>() = {
diff --git a/test/files/run/t5603.check b/test/files/run/t5603.check
index 5127d3c1c7..3f19a0a4b1 100644
--- a/test/files/run/t5603.check
+++ b/test/files/run/t5603.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of parser]] // newSource1
+[[syntax trees at end of parser]] // newSource1.scala
[0:241]package [0:0]<empty> {
[0:82]abstract trait Greeting extends [15:82][83]scala.AnyRef {
[15]def $init$() = [15]{
diff --git a/test/files/run/t6028.check b/test/files/run/t6028.check
index 94013efd36..613d25b075 100644
--- a/test/files/run/t6028.check
+++ b/test/files/run/t6028.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of lambdalift]] // newSource1
+[[syntax trees at end of lambdalift]] // newSource1.scala
package <empty> {
class T extends Object {
<paramaccessor> val T$$classParam: Int = _;
diff --git a/test/files/run/t6288.check b/test/files/run/t6288.check
index e6467edc95..e940975e44 100644
--- a/test/files/run/t6288.check
+++ b/test/files/run/t6288.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of patmat]] // newSource1
+[[syntax trees at end of patmat]] // newSource1.scala
[7]package [7]<empty> {
[7]object Case3 extends [13][106]scala.AnyRef {
[13]def <init>(): [13]Case3.type = [13]{
diff --git a/test/files/run/t6440.check b/test/files/run/t6440.check
index 69c253eab4..806279fb74 100644
--- a/test/files/run/t6440.check
+++ b/test/files/run/t6440.check
@@ -1,4 +1,4 @@
-pos: source-newSource1,line-9,offset=109 bad symbolic reference. A signature in U.class refers to term pack1
+pos: source-newSource1.scala,line-9,offset=109 bad symbolic reference. A signature in U.class refers to term pack1
in package <root> which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling U.class. ERROR
diff --git a/test/files/run/t6555.check b/test/files/run/t6555.check
index 04117b7c2f..a18a8e8023 100644
--- a/test/files/run/t6555.check
+++ b/test/files/run/t6555.check
@@ -1,4 +1,4 @@
-[[syntax trees at end of specialize]] // newSource1
+[[syntax trees at end of specialize]] // newSource1.scala
package <empty> {
class Foo extends Object {
def <init>(): Foo = {
diff --git a/test/files/run/t7271.check b/test/files/run/t7271.check
new file mode 100644
index 0000000000..dcd828a307
--- /dev/null
+++ b/test/files/run/t7271.check
@@ -0,0 +1,12 @@
+[[syntax trees at end of parser]] // newSource1.scala
+[0:91]package [0:0]<empty> {
+ [0:91]class C extends [8:91][91]scala.AnyRef {
+ [8]def <init>() = [8]{
+ [8][8][8]super.<init>();
+ [8]()
+ };
+ [16:44]def quote = [28:44]<28:44><28:44>[28]StringContext([30:34]"foo", [40:44]"baz").s([35:39]this);
+ [51:85]def tripleQuote = [69:85]<69:85><69:85>[69]StringContext([71:75]"foo", [81:85]"baz").s([76:80]this)
+ }
+}
+
diff --git a/test/files/run/t7271.scala b/test/files/run/t7271.scala
new file mode 100644
index 0000000000..6fccf14d20
--- /dev/null
+++ b/test/files/run/t7271.scala
@@ -0,0 +1,34 @@
+import scala.tools.partest._
+import java.io._
+import scala.tools.nsc._
+import scala.tools.nsc.util.CommandLineParser
+import scala.tools.nsc.{Global, Settings, CompilerCommand}
+import scala.tools.nsc.reporters.ConsoleReporter
+
+object Test extends DirectTest {
+
+ override def extraSettings: String = "-usejavacp -Xprint:parser -Ystop-after:parser -d " + testOutput.path
+
+ override def code = """
+ class C {
+ def quote = s"foo${this}baz"
+ def tripleQuote = s"foo${this}baz"
+ }
+ """.trim
+
+ override def show(): Unit = {
+ // redirect err to out, for logging
+ val prevErr = System.err
+ System.setErr(System.out)
+ compile()
+ System.setErr(prevErr)
+ }
+
+ override def newCompiler(args: String*): Global = {
+
+ val settings = new Settings()
+ settings.Xprintpos.value = true
+ val command = new CompilerCommand((CommandLineParser tokenize extraSettings) ++ args.toList, settings)
+ new Global(command.settings, new ConsoleReporter(settings)) with interactive.RangePositions
+ }
+}
diff --git a/test/files/run/t7325.check b/test/files/run/t7325.check
new file mode 100644
index 0000000000..3c7652f42c
--- /dev/null
+++ b/test/files/run/t7325.check
@@ -0,0 +1,19 @@
+%
+%%
+%%%
+%n
+%
+
+%%n
+%%
+
+%%%n
+%%%
+
+0
+0%d
+0%%d
+0
+
+0
+
diff --git a/test/files/run/t7325.scala b/test/files/run/t7325.scala
new file mode 100644
index 0000000000..26f6bc6ef7
--- /dev/null
+++ b/test/files/run/t7325.scala
@@ -0,0 +1,25 @@
+object Test extends App {
+ // println(f"%")
+ println(f"%%")
+ // println(f"%%%")
+ println(f"%%%%")
+ // println(f"%%%%%")
+ println(f"%%%%%%")
+
+ println(f"%%n")
+ println(f"%%%n")
+ println(f"%%%%n")
+ println(f"%%%%%n")
+ println(f"%%%%%%n")
+ println(f"%%%%%%%n")
+
+ // println(f"${0}%")
+ println(f"${0}%d")
+ println(f"${0}%%d")
+ // println(f"${0}%%%d")
+ println(f"${0}%%%%d")
+ // println(f"${0}%%%%%d")
+
+ println(f"${0}%n")
+ println(f"${0}%d%n")
+} \ No newline at end of file
diff --git a/test/files/run/t7398.scala b/test/files/run/t7398.scala
new file mode 100644
index 0000000000..e4090f7db3
--- /dev/null
+++ b/test/files/run/t7398.scala
@@ -0,0 +1,31 @@
+import scala.tools.partest._
+
+object Test extends CompilerTest {
+ import global._
+
+ def javaVersion = scala.util.Properties.javaVersion
+ def isJavaEight = javaVersion startsWith "1.8"
+ // This way we auto-pass on non-java8 since there's nothing to check
+ override lazy val units = {
+ val res: List[CompilationUnit] = if (isJavaEight) javaCompilationUnits(global)(defaultMethodSource) else Nil
+ val word = if (isJavaEight) "Attempting" else "Skipping"
+ log(s"$word java8-specific test under java version $javaVersion")
+ res
+ }
+
+ private def defaultMethodSource = """
+public interface Iterator<E> {
+ boolean hasNext();
+ E next();
+ default void remove() {
+ throw new UnsupportedOperationException("remove");
+ }
+ default void forEachRemaining(Consumer<? super E> action) {
+ throw new UnsupportedOperationException("forEachRemaining");
+ }
+}
+ """
+
+ // We're only checking we can parse it.
+ def check(source: String, unit: global.CompilationUnit): Unit = ()
+}
diff --git a/test/files/run/typetags_without_scala_reflect_typetag_lookup.check b/test/files/run/typetags_without_scala_reflect_typetag_lookup.check
index 8c558ced60..84e5435afe 100644
--- a/test/files/run/typetags_without_scala_reflect_typetag_lookup.check
+++ b/test/files/run/typetags_without_scala_reflect_typetag_lookup.check
@@ -1,2 +1,2 @@
-pos: source-newSource1,line-9,offset=466 could not find implicit value for evidence parameter of type reflect.runtime.package.universe.TypeTag[Int] ERROR
+pos: source-newSource1.scala,line-9,offset=466 could not find implicit value for evidence parameter of type reflect.runtime.package.universe.TypeTag[Int] ERROR
diff --git a/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check b/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check
index acfecce628..8c9d07d836 100644
--- a/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check
+++ b/test/files/run/typetags_without_scala_reflect_typetag_manifest_interop.check
@@ -1,2 +1,2 @@
-pos: source-newSource1,line-9,offset=479 No Manifest available for App.this.T. ERROR
+pos: source-newSource1.scala,line-9,offset=479 No Manifest available for App.this.T. ERROR