From 7f4720c5dbd0711983e1abb8be3781e7d53b049b Mon Sep 17 00:00:00 2001 From: Mirco Dotta Date: Tue, 3 Dec 2013 11:45:35 +0100 Subject: SI-4287 Added test demonstrating hyperlinking to constructor's argument This test was inspired by `test/files/run/t5603`, whose output (.check file) will need to be updated in the upcoming commit that fixes SI-4287, because the positions associated to the tree have slightly changed. The additional test should demonstrate that the change in positions isn't relevant, and it doesn't affect functionality. In fact, hyperlinking to a constructor's argument work as expected before and after fixing SI-4287. --- test/files/presentation/t4287b.check | 6 ++++++ test/files/presentation/t4287b/Test.scala | 3 +++ test/files/presentation/t4287b/src/Foo.scala | 15 +++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 test/files/presentation/t4287b.check create mode 100644 test/files/presentation/t4287b/Test.scala create mode 100644 test/files/presentation/t4287b/src/Foo.scala (limited to 'test/files/presentation') diff --git a/test/files/presentation/t4287b.check b/test/files/presentation/t4287b.check new file mode 100644 index 0000000000..d4b33650fd --- /dev/null +++ b/test/files/presentation/t4287b.check @@ -0,0 +1,6 @@ +reload: Foo.scala + +askHyperlinkPos for `i` at (14,11) Foo.scala +================================================================================ +[response] found askHyperlinkPos for `i` at (10,9) Foo.scala +================================================================================ diff --git a/test/files/presentation/t4287b/Test.scala b/test/files/presentation/t4287b/Test.scala new file mode 100644 index 0000000000..bec1131c4c --- /dev/null +++ b/test/files/presentation/t4287b/Test.scala @@ -0,0 +1,3 @@ +import scala.tools.nsc.interactive.tests.InteractiveTest + +object Test extends InteractiveTest \ No newline at end of file diff --git a/test/files/presentation/t4287b/src/Foo.scala b/test/files/presentation/t4287b/src/Foo.scala new file mode 100644 index 0000000000..47c676e2a2 --- /dev/null +++ b/test/files/presentation/t4287b/src/Foo.scala @@ -0,0 +1,15 @@ +trait Greeting { + val name: String + val msg = "How are you, "+name +} + +object Greeting { + val hello = "hello" +} + +class C(i: Int) extends { + val nameElse = "Bob" +} with Greeting { + val name = "avc" + println(i/*#*/) +} \ No newline at end of file -- cgit v1.2.3