summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/javacs/GotoTest.java7
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/Goto.java4
-rw-r--r--src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java5
3 files changed, 16 insertions, 0 deletions
diff --git a/src/test/java/org/javacs/GotoTest.java b/src/test/java/org/javacs/GotoTest.java
index 6587eca..5eb0a52 100644
--- a/src/test/java/org/javacs/GotoTest.java
+++ b/src/test/java/org/javacs/GotoTest.java
@@ -168,6 +168,13 @@ public class GotoTest {
assertThat(doGoto(file, 5, 22), empty());
}
+ @Test
+ public void packagePrivate() {
+ var suggestions = doGoto(file, 50, 42);
+
+ assertThat(suggestions, hasItem("GotoPackagePrivate.java:4"));
+ }
+
private static final JavaLanguageServer server = LanguageServerFixture.getJavaLanguageServer();
private List<String> doGoto(String file, int row, int column) {
diff --git a/src/test/test-project/workspace/src/org/javacs/example/Goto.java b/src/test/test-project/workspace/src/org/javacs/example/Goto.java
index 3f4cb2f..6d1b698 100644
--- a/src/test/test-project/workspace/src/org/javacs/example/Goto.java
+++ b/src/test/test-project/workspace/src/org/javacs/example/Goto.java
@@ -45,4 +45,8 @@ public class Goto<Param> {
}
public Param getParam() {
}
+
+ void testGotoPackagePrivate() {
+ var x = GotoPackagePrivate.PUBLIC_FIELD;
+ }
} \ No newline at end of file
diff --git a/src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java b/src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java
new file mode 100644
index 0000000..0c5ba11
--- /dev/null
+++ b/src/test/test-project/workspace/src/org/javacs/example/GotoPackagePrivate.java
@@ -0,0 +1,5 @@
+package org.javacs.example;
+
+class GotoPackagePrivate {
+ public static int PUBLIC_FIELD = 1;
+} \ No newline at end of file