Skip to content

Commit

Permalink
Adjusting tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Nov 11, 2024
1 parent 7bfdd2a commit aea3db4
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/*
* @test
* @bug 8305457
* @summary java.io.IO tests
* @summary java.lang.IO tests
* @library /test/lib
* @run junit IO
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import java.io.IOException;

import static java.io.IO.readln;
import static java.lang.IO.readln;

public class Input {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* questions.
*/

import static java.io.IO.*;
import static java.lang.IO.*;

public class Methods {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* questions.
*/

import static java.io.IO.*;
import static java.lang.IO.*;
import java.util.function.Consumer;

public class Output {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/jdk/jdk/internal/jline/LazyJdkConsoleProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @run main LazyJdkConsoleProvider
*/

import java.io.IO;
import java.lang.IO;
import jdk.internal.org.jline.reader.LineReader;
import jdk.internal.org.jline.terminal.Terminal;

Expand Down
37 changes: 17 additions & 20 deletions test/langtools/tools/javac/ImplicitClass/ImplicitImports.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,29 +148,26 @@ public static void main(String... args) {

Files.createDirectories(classes);

new JavacTask(tb)
.options("--enable-preview", "--release", SOURCE_VERSION,
"--patch-module", "java.base=" + patchClasses)
.outdir(classes)
.files(tb.findJavaFiles(src))
.run(Task.Expect.SUCCESS)
.writeAll();

var out = new JavaTask(tb)
.classpath(classes.toString())
.className("Test")
.vmOptions("--enable-preview",
"--patch-module", "java.base=" + patchClasses)
.run()
var log = new JavacTask(tb)
.options("--enable-preview", "--release", SOURCE_VERSION,
"--patch-module", "java.base=" + patchClasses,
"-XDrawDiagnostics")
.outdir(classes)
.files(tb.findJavaFiles(src))
.run(Task.Expect.FAIL)
.writeAll()
.getOutputLines(Task.OutputKind.STDOUT);

var expectedOut = List.of("Hello, World!");
.getOutputLines(OutputKind.DIRECT);

if (!Objects.equals(expectedOut, out)) {
throw new AssertionError("Incorrect Output, expected: " + expectedOut +
", actual: " + out);
var expectedLog = List.of(
"Test.java:2:5: compiler.err.cant.resolve.location.args: kindname.method, println, , java.lang.String, (compiler.misc.location: kindname.class, Test, null)",
"- compiler.note.preview.filename: Test.java, DEFAULT",
"- compiler.note.preview.recompile",
"1 error"
);

if (!Objects.equals(expectedLog, log)) {
throw new AssertionError("Incorrect Output, expected: " + expectedLog +
", actual: " + log);
}
}

Expand Down
1 change: 1 addition & 0 deletions test/langtools/tools/javac/diags/examples.not-yet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ compiler.warn.illegal.char.for.encoding
compiler.warn.incubating.modules # requires adjusted classfile
compiler.warn.invalid.archive.file
compiler.warn.invalid.utf8.in.classfile # bad class file
compiler.warn.is.preview # difficult to produce reliably despite future changes to java.base
compiler.warn.is.preview.reflective # difficult to produce reliably despite future changes to java.base
compiler.warn.output.file.clash # this warning is not generated on Linux
compiler.warn.override.bridge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

// key: compiler.misc.feature.implicit.classes
// key: compiler.warn.preview.feature.use.plural
// key: compiler.warn.is.preview
// options: -source ${jdk.version} --enable-preview -Xlint:preview

public static void main(String... args) {
Expand Down

0 comments on commit aea3db4

Please sign in to comment.