summaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-12-27 15:51:47 -0800
committerGeorge Fraser <george@fivetran.com>2018-12-27 15:51:47 -0800
commit4aceea3d0eba771184ba299eb39be5b366eefdf6 (patch)
tree4303bbea17ca1a476c3a5dc79c29fd07f58fa5e0 /src/test/java
parenta23d35939edaf22844b0170b0348f1f788aafbab (diff)
downloadjava-language-server-4aceea3d0eba771184ba299eb39be5b366eefdf6.zip
Fewer code lenses
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/javacs/CodeLensTest.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/test/java/org/javacs/CodeLensTest.java b/src/test/java/org/javacs/CodeLensTest.java
index 45244c7..9383de8 100644
--- a/src/test/java/org/javacs/CodeLensTest.java
+++ b/src/test/java/org/javacs/CodeLensTest.java
@@ -55,7 +55,9 @@ public class CodeLensTest {
private List<String> titles(List<? extends CodeLens> lenses) {
var titles = new ArrayList<String>();
for (var lens : lenses) {
- titles.add(lens.getCommand().getTitle());
+ var line = lens.getRange().getStart().getLine() + 1;
+ var title = lens.getCommand().getTitle();
+ titles.add(line + ":" + title);
}
return titles;
}
@@ -77,6 +79,14 @@ public class CodeLensTest {
assertThat(lenses, not(empty()));
var titles = titles(lenses);
- assertThat(titles, hasItem("2 references"));
+ assertThat(titles, hasItem("4:2 references"));
+ assertThat(titles, hasItem("6:2 references"));
+ }
+
+ @Test
+ public void enumConstants() {
+ var lenses = lenses("/org/javacs/example/DontShowEnumConstRefs.java");
+ var titles = titles(lenses);
+ assertThat(titles, not(hasItem("4:0 references")));
}
}