test/langtools/jdk/jshell/ToolBasicTest.java
changeset 49101 206a6f728ce5
parent 49092 6dc5e0cdb44c
parent 48939 ba545e52b932
child 50017 88cc95780b6e
equal deleted inserted replaced
49100:bec86eb4a71a 49101:206a6f728ce5
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304 8167554 8180508 8196133
    26  * @bug 8143037 8142447 8144095 8140265 8144906 8146138 8147887 8147886 8148316 8148317 8143955 8157953 8080347 8154714 8166649 8167643 8170162 8172102 8165405 8174796 8174797 8175304 8167554 8180508 8166232 8196133
    27  * @summary Tests for Basic tests for REPL tool
    27  * @summary Tests for Basic tests for REPL tool
    28  * @modules jdk.compiler/com.sun.tools.javac.api
    28  * @modules jdk.compiler/com.sun.tools.javac.api
    29  *          jdk.compiler/com.sun.tools.javac.main
    29  *          jdk.compiler/com.sun.tools.javac.main
    30  *          jdk.jdeps/com.sun.tools.javap
    30  *          jdk.jdeps/com.sun.tools.javap
    31  *          jdk.jshell/jdk.internal.jshell.tool
    31  *          jdk.jshell/jdk.internal.jshell.tool
   678         );
   678         );
   679     }
   679     }
   680 
   680 
   681     public void testHistoryReference() {
   681     public void testHistoryReference() {
   682         test(false, new String[]{"--no-startup"},
   682         test(false, new String[]{"--no-startup"},
       
   683                 a -> assertCommand(a, "System.err.println(99)", "", "", null, "", "99\n"),
       
   684                 a -> assertCommand(a, "/exit", "")
       
   685         );
       
   686         test(false, new String[]{"--no-startup"},
   683                 a -> assertCommand(a, "System.err.println(1)", "", "", null, "", "1\n"),
   687                 a -> assertCommand(a, "System.err.println(1)", "", "", null, "", "1\n"),
   684                 a -> assertCommand(a, "System.err.println(2)", "", "", null, "", "2\n"),
   688                 a -> assertCommand(a, "System.err.println(2)", "", "", null, "", "2\n"),
   685                 a -> assertCommand(a, "/-2", "System.err.println(1)", "", null, "", "1\n"),
   689                 a -> assertCommand(a, "/-2", "System.err.println(1)", "", null, "", "1\n"),
   686                 a -> assertCommand(a, "/history",
   690                 a -> assertCommand(a, "/history",
   687                                                     "/debug 0\n" +
   691                                                     "/debug 0\n" +
   688                                                     "System.err.println(1)\n" +
   692                                                     "System.err.println(1)\n" +
   689                                                     "System.err.println(2)\n" +
   693                                                     "System.err.println(2)\n" +
   690                                                     "System.err.println(1)\n" +
   694                                                     "System.err.println(1)\n" +
   691                                                     "/history\n"),
   695                                                     "/history\n"),
       
   696                 a -> assertCommand(a, "/history -all",
       
   697                                                     "/debug 0\n" +
       
   698                                                     "System.err.println(99)\n" +
       
   699                                                     "/exit\n" +
       
   700                                                     "/debug 0\n" +
       
   701                                                     "System.err.println(1)\n" +
       
   702                                                     "System.err.println(2)\n" +
       
   703                                                     "System.err.println(1)\n" +
       
   704                                                     "/history\n" +
       
   705                                                     "/history -all\n"),
   692                 a -> assertCommand(a, "/-2", "System.err.println(2)", "", null, "", "2\n"),
   706                 a -> assertCommand(a, "/-2", "System.err.println(2)", "", null, "", "2\n"),
   693                 a -> assertCommand(a, "/!", "System.err.println(2)", "", null, "", "2\n"),
   707                 a -> assertCommand(a, "/!", "System.err.println(2)", "", null, "", "2\n"),
   694                 a -> assertCommand(a, "/2", "System.err.println(2)", "", null, "", "2\n"),
   708                 a -> assertCommand(a, "/2", "System.err.println(2)", "", null, "", "2\n"),
   695                 a -> assertCommand(a, "/1", "System.err.println(1)", "", null, "", "1\n")
   709                 a -> assertCommand(a, "/1", "System.err.println(1)", "", null, "", "1\n")
   696         );
   710         );