summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t8064.flags1
-rw-r--r--test/files/pos/t8064/Client_2.scala8
-rw-r--r--test/files/pos/t8064/Macro_1.scala10
-rw-r--r--test/files/pos/t8064b.flags1
-rw-r--r--test/files/pos/t8064b/Client_2.scala6
-rw-r--r--test/files/pos/t8064b/Macro_1.scala11
-rw-r--r--test/files/presentation/hyperlinks-macro.check11
-rw-r--r--test/files/presentation/hyperlinks-macro/Runner.scala8
-rw-r--r--test/files/presentation/hyperlinks-macro/src/MacroCall.scala11
-rw-r--r--test/scaladoc/run/SI-6812.check1
-rw-r--r--test/scaladoc/run/SI-6812.scala2
-rw-r--r--test/scaladoc/run/SI-6812b.check1
-rw-r--r--test/scaladoc/run/SI-6812b.scala24
13 files changed, 94 insertions, 1 deletions
diff --git a/test/files/pos/t8064.flags b/test/files/pos/t8064.flags
new file mode 100644
index 0000000000..281f0a10cd
--- /dev/null
+++ b/test/files/pos/t8064.flags
@@ -0,0 +1 @@
+-Yrangepos
diff --git a/test/files/pos/t8064/Client_2.scala b/test/files/pos/t8064/Client_2.scala
new file mode 100644
index 0000000000..44106782c7
--- /dev/null
+++ b/test/files/pos/t8064/Client_2.scala
@@ -0,0 +1,8 @@
+object Test {
+ Macro {
+ def s = ""
+ Macro(s): @unchecked
+ ???
+ }
+}
+// Was: a range position validation error (unpositioned tree) \ No newline at end of file
diff --git a/test/files/pos/t8064/Macro_1.scala b/test/files/pos/t8064/Macro_1.scala
new file mode 100644
index 0000000000..4fabd54a89
--- /dev/null
+++ b/test/files/pos/t8064/Macro_1.scala
@@ -0,0 +1,10 @@
+import language.experimental.macros
+import scala.reflect.macros.Context
+
+object Macro {
+ def apply(a: Any): Any = macro impl
+
+ def impl(c: Context)(a: c.Tree): c.Tree = {
+ c.resetLocalAttrs(a)
+ }
+}
diff --git a/test/files/pos/t8064b.flags b/test/files/pos/t8064b.flags
new file mode 100644
index 0000000000..281f0a10cd
--- /dev/null
+++ b/test/files/pos/t8064b.flags
@@ -0,0 +1 @@
+-Yrangepos
diff --git a/test/files/pos/t8064b/Client_2.scala b/test/files/pos/t8064b/Client_2.scala
new file mode 100644
index 0000000000..a7bf2b9fb4
--- /dev/null
+++ b/test/files/pos/t8064b/Client_2.scala
@@ -0,0 +1,6 @@
+object Test {
+ Macro {
+ "".reverse
+ }
+}
+// Was: a range position validation error (tree with offset position enclosing tree with range position) \ No newline at end of file
diff --git a/test/files/pos/t8064b/Macro_1.scala b/test/files/pos/t8064b/Macro_1.scala
new file mode 100644
index 0000000000..82582356c0
--- /dev/null
+++ b/test/files/pos/t8064b/Macro_1.scala
@@ -0,0 +1,11 @@
+import language.experimental.macros
+import scala.reflect.macros.Context
+
+object Macro {
+ def apply(a: Any): Any = macro impl
+ def impl(c: Context)(a: c.Tree): c.Tree = {
+ import c.universe._
+
+ q"{$a; true}"
+ }
+}
diff --git a/test/files/presentation/hyperlinks-macro.check b/test/files/presentation/hyperlinks-macro.check
new file mode 100644
index 0000000000..80d2268fa1
--- /dev/null
+++ b/test/files/presentation/hyperlinks-macro.check
@@ -0,0 +1,11 @@
+reload: MacroCall.scala
+
+askHyperlinkPos for `foo` at (5,7) MacroCall.scala
+================================================================================
+[response] found askHyperlinkPos for `foo` at (2,7) MacroCall.scala
+================================================================================
+
+askHyperlinkPos for `foo` at (9,7) MacroCall.scala
+================================================================================
+[response] found askHyperlinkPos for `foo` at (2,7) MacroCall.scala
+================================================================================
diff --git a/test/files/presentation/hyperlinks-macro/Runner.scala b/test/files/presentation/hyperlinks-macro/Runner.scala
new file mode 100644
index 0000000000..c2f89bdb17
--- /dev/null
+++ b/test/files/presentation/hyperlinks-macro/Runner.scala
@@ -0,0 +1,8 @@
+import scala.tools.nsc.interactive.tests.InteractiveTest
+
+object Test extends InteractiveTest {
+ override def runDefaultTests() {
+ sourceFiles foreach (src => askLoadedTyped(src).get)
+ super.runDefaultTests()
+ }
+}
diff --git a/test/files/presentation/hyperlinks-macro/src/MacroCall.scala b/test/files/presentation/hyperlinks-macro/src/MacroCall.scala
new file mode 100644
index 0000000000..d9676b3d2a
--- /dev/null
+++ b/test/files/presentation/hyperlinks-macro/src/MacroCall.scala
@@ -0,0 +1,11 @@
+object Test {
+ def foo = 0
+
+ scala.reflect.runtime.universe.reify {
+ foo/*#*/
+ }
+
+ identity {
+ foo/*#*/
+ }
+}
diff --git a/test/scaladoc/run/SI-6812.check b/test/scaladoc/run/SI-6812.check
index 619c56180b..3be8a300e7 100644
--- a/test/scaladoc/run/SI-6812.check
+++ b/test/scaladoc/run/SI-6812.check
@@ -1 +1,2 @@
+warning: -Ymacro-no-expand is deprecated: Use -Ymacro-expand:none
Done.
diff --git a/test/scaladoc/run/SI-6812.scala b/test/scaladoc/run/SI-6812.scala
index 059c327e7e..6893e816d0 100644
--- a/test/scaladoc/run/SI-6812.scala
+++ b/test/scaladoc/run/SI-6812.scala
@@ -19,6 +19,6 @@ object Test extends ScaladocModelTest {
"""
def scaladocSettings = ""
- override def extraSettings = super.extraSettings + " -Ymacro-no-expand"
+ override def extraSettings = super.extraSettings + " -Ymacro-no-expand -deprecation"
def testModel(root: Package) = ()
}
diff --git a/test/scaladoc/run/SI-6812b.check b/test/scaladoc/run/SI-6812b.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/SI-6812b.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/SI-6812b.scala b/test/scaladoc/run/SI-6812b.scala
new file mode 100644
index 0000000000..b8a8140357
--- /dev/null
+++ b/test/scaladoc/run/SI-6812b.scala
@@ -0,0 +1,24 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+import language._
+
+object Test extends ScaladocModelTest {
+
+ override def code = """
+ import scala.reflect.macros.BlackboxContext
+ import language.experimental.macros
+
+ object Macros {
+ def impl(c: BlackboxContext) = c.literalUnit
+ def foo: Unit = macro impl
+ }
+
+ class C {
+ def bar = Macros.foo
+ }
+ """
+
+ def scaladocSettings = ""
+ override def extraSettings = super.extraSettings + " -Ymacro-expand:none"
+ def testModel(root: Package) = ()
+}