test/langtools/jdk/jshell/ToolBasicTest.java
changeset 48440 f91345a216c9
parent 47504 58ce36f43f1a
child 48939 ba545e52b932
child 49092 6dc5e0cdb44c
equal deleted inserted replaced
48439:b39894f95ab8 48440:f91345a216c9
   187         );
   187         );
   188     }
   188     }
   189 
   189 
   190     public void testRerun() {
   190     public void testRerun() {
   191         test(false, new String[] {"--no-startup"},
   191         test(false, new String[] {"--no-startup"},
   192                 (a) -> assertCommand(a, "/0", "|  No snippet with id: 0"),
   192                 (a) -> assertCommand(a, "/0", "|  No snippet with ID: 0"),
   193                 (a) -> assertCommand(a, "/5", "|  No snippet with id: 5")
   193                 (a) -> assertCommand(a, "/5", "|  No snippet with ID: 5")
   194         );
   194         );
   195         String[] codes = new String[] {
   195         String[] codes = new String[] {
   196                 "int a = 0;", // var
   196                 "int a = 0;", // var
   197                 "class A {}", // class
   197                 "class A {}", // class
   198                 "void f() {}", // method
   198                 "void f() {}", // method
   249                 assertRerun.apply("/e1").apply("add(ONE)", 3), assertVariables,
   249                 assertRerun.apply("/e1").apply("add(ONE)", 3), assertVariables,
   250                 assertRerun.apply("/s1").apply("int assertionCount = 0;", 0), assertVariables
   250                 assertRerun.apply("/s1").apply("int assertionCount = 0;", 0), assertVariables
   251         );
   251         );
   252 
   252 
   253         test(false, new String[] {"--no-startup"},
   253         test(false, new String[] {"--no-startup"},
   254                 (a) -> assertCommand(a, "/s1", "|  No snippet with id: s1"),
   254                 (a) -> assertCommand(a, "/s1", "|  No snippet with ID: s1"),
   255                 (a) -> assertCommand(a, "/1", "|  No snippet with id: 1"),
   255                 (a) -> assertCommand(a, "/1", "|  No snippet with ID: 1"),
   256                 (a) -> assertCommand(a, "/e1", "|  No snippet with id: e1")
   256                 (a) -> assertCommand(a, "/e1", "|  No snippet with ID: e1")
   257         );
   257         );
   258     }
   258     }
   259 
   259 
   260     public void testClasspathDirectory() {
   260     public void testClasspathDirectory() {
   261         Compiler compiler = new Compiler();
   261         Compiler compiler = new Compiler();