8141415: JShell: wrap erroneous with one-liner comment-outed imports

Reviewed-by: rfield
This commit is contained in:
Shinya Yoshida 2016-05-29 23:46:49 +09:00
parent 58de940c2f
commit 3ff9cf19e2
2 changed files with 7 additions and 1 deletions

View File

@ -101,6 +101,6 @@ public class ImportSnippet extends PersistentSnippet {
@Override
String importLine(JShell state) {
return source();
return guts().wrapped();
}
}

View File

@ -23,6 +23,7 @@
/*
* @test
* @bug 8141415
* @summary Test imports
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
@ -162,4 +163,9 @@ public class ImportTest extends KullaTesting {
assertEval("field;", "\"A\"");
assertEval("method();", "\"A\"");
}
public void testImportWithComment() {
assertImportKeyMatch("import java.util.List;//comment", "List", SINGLE_TYPE_IMPORT_SUBKIND, added(VALID));
assertEval("List l = null;");
}
}