|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
51 | 51 | import java.nio.file.Paths;
|
52 | 52 | import java.util.ArrayList;
|
53 | 53 | import java.util.Collections;
|
54 |
| -import java.util.HashMap; |
55 |
| -import java.util.Map; |
56 | 54 | import java.util.List;
|
57 | 55 | import java.util.Properties;
|
58 | 56 | import java.util.regex.Pattern;
|
59 |
| -import java.util.stream.Collectors; |
60 | 57 |
|
61 | 58 | import com.sun.tools.javac.launcher.SourceLauncher;
|
62 | 59 | import com.sun.tools.javac.launcher.Fault;
|
@@ -534,10 +531,9 @@ public void testEnablePreviewNoSource(Path base) throws IOException {
|
534 | 531 | List<String> log = new JavaTask(tb)
|
535 | 532 | .vmOptions("--enable-preview")
|
536 | 533 | .className(base.resolve("HelloWorld.java").toString())
|
537 |
| - .run(Task.Expect.FAIL) |
538 |
| - .getOutputLines(Task.OutputKind.STDERR); |
539 |
| - log = log.stream().filter(s->!s.matches("^Picked up .*JAVA.*OPTIONS:.*")).collect(Collectors.toList()); |
540 |
| - checkEqual("stderr", log, List.of("error: --enable-preview must be used with --source")); |
| 534 | + .run(Task.Expect.SUCCESS) |
| 535 | + .getOutputLines(Task.OutputKind.STDOUT); |
| 536 | + checkEqual("stdout", log, List.of("Hello World! []")); |
541 | 537 | }
|
542 | 538 |
|
543 | 539 | @Test
|
|
0 commit comments