mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-20 16:09:21 +00:00
8210808: jshell tool: only considers the first snippet of the external editor
Reviewed-by: jlahoda, sundar
This commit is contained in:
parent
7a9db013b7
commit
37ef084d73
@ -2936,7 +2936,7 @@ public class JShellTool implements MessageHandler {
|
||||
}
|
||||
String tsrc = trimNewlines(an.source());
|
||||
if (!failed && !currSrcs.contains(tsrc)) {
|
||||
failed = processSource(tsrc);
|
||||
failed = !processSource(tsrc);
|
||||
}
|
||||
nextSrcs.add(tsrc);
|
||||
if (an.remaining().isEmpty()) {
|
||||
|
||||
@ -125,6 +125,24 @@ public abstract class EditorTestBase extends ReplToolTesting {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWriteVariables() {
|
||||
testEditor(
|
||||
a -> assertEditOutput(a, "/edit",
|
||||
"x ==> 1\n" +
|
||||
"y ==> 2\n" +
|
||||
"z ==> 3",
|
||||
() -> {
|
||||
writeSource(
|
||||
"var x = 1;\n" +
|
||||
"var y = 2;\n" +
|
||||
"var z = 3;\n");
|
||||
exit();
|
||||
}),
|
||||
a -> assertCommand(a, "z", "z ==> 3")
|
||||
);
|
||||
}
|
||||
|
||||
public void testEditClass1() {
|
||||
testEditor(
|
||||
a -> assertClass(a, "class A {}", "class", "A"),
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @summary Testing external editor.
|
||||
* @bug 8143955 8080843 8163816 8143006 8169828 8171130 8162989
|
||||
* @bug 8143955 8080843 8163816 8143006 8169828 8171130 8162989 8210808
|
||||
* @modules jdk.jshell/jdk.internal.jshell.tool
|
||||
* @build ReplToolTesting CustomEditor EditorTestBase
|
||||
* @run testng ExternalEditorTest
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user