test/langtools/jdk/jshell/ToolTabSnippetTest.java
changeset 47518 783d04ecccc3
parent 47517 b5ad886110b3
parent 47484 d0cb66d8cbf1
child 48275 b2190c70a1ac
--- a/test/langtools/jdk/jshell/ToolTabSnippetTest.java	Thu Nov 02 11:09:28 2017 -0700
+++ b/test/langtools/jdk/jshell/ToolTabSnippetTest.java	Fri Nov 03 09:56:02 2017 -0700
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8177076 8185426 8188072
+ * @bug 8177076 8185426 8189595 8188072
  * @modules
  *     jdk.compiler/com.sun.tools.javac.api
  *     jdk.compiler/com.sun.tools.javac.main
@@ -231,6 +231,31 @@
         });
     }
 
+    public void testNoRepeat() throws Exception {
+        doRunTest((inputSink, out) -> {
+            inputSink.write("String xyzAA;\n");
+            waitOutput(out, "\u0005");
+
+            //xyz<tab>
+            inputSink.write("String s = xyz\011");
+            waitOutput(out, "^String s = xyzAA");
+            inputSink.write(".");
+            waitOutput(out, "^\\.");
+
+            inputSink.write("\u0003");
+            waitOutput(out, "\u0005");
+
+            inputSink.write("double xyzAB;\n");
+            waitOutput(out, "\u0005");
+
+            //xyz<tab>
+            inputSink.write("String s = xyz\011");
+            String allCompletions =
+                    Pattern.quote(getResource("jshell.console.completion.all.completions"));
+            waitOutput(out, ".*xyzAA.*" + allCompletions + ".*\u0005String s = xyzA");
+        });
+    }
+
     private Path prepareZip() {
         String clazz1 =
                 "package jshelltest;\n" +