equal
deleted
inserted
replaced
234 InputStream in_orig = System.in; |
234 InputStream in_orig = System.in; |
235 PrintStream out_orig = System.out; |
235 PrintStream out_orig = System.out; |
236 PrintStream err_orig = System.err; |
236 PrintStream err_orig = System.err; |
237 ByteArrayInputStream in = new ByteArrayInputStream(new byte[0]); |
237 ByteArrayInputStream in = new ByteArrayInputStream(new byte[0]); |
238 ByteArrayOutputStream out = new ByteArrayOutputStream(); |
238 ByteArrayOutputStream out = new ByteArrayOutputStream(); |
239 PrintStream out_stream = new PrintStream(out); |
|
240 |
239 |
241 // Single-threaded context! |
240 // Single-threaded context! |
242 try { |
241 try { |
|
242 PrintStream out_stream = new PrintStream(out); |
243 System.setIn(in); |
243 System.setIn(in); |
244 System.setOut(out_stream); |
244 System.setOut(out_stream); |
245 System.setErr(out_stream); |
245 System.setErr(out_stream); |
246 ok = new MainClass().process(args.toArray(String[]::new)); |
246 ok = new MainClass().process(args.toArray(String[]::new)); |
|
247 out_stream.flush(); |
247 } |
248 } |
248 finally { |
249 finally { |
249 System.setIn(in_orig); |
250 System.setIn(in_orig); |
250 System.setOut(out_orig); |
251 System.setOut(out_orig); |
251 System.setErr(err_orig); |
252 System.setErr(err_orig); |