Skip to content

Commit

Permalink
use the new Result.assertNoErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed May 21, 2024
1 parent 781b73b commit 711984a
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
*******************************************************************************/
package org.eclipse.xtext.xbase.tests.compiler;

import java.util.stream.Collectors;

import org.eclipse.xtext.diagnostics.Severity;
import org.eclipse.xtext.util.JavaRuntimeVersion;
import org.eclipse.xtext.util.Strings;
import org.eclipse.xtext.xbase.testing.CompilationTestHelper;
Expand Down Expand Up @@ -65,14 +62,9 @@ public class Java21RecordCompilerTest extends AbstractJvmModelTest {
+ " }\n"
+ "}\n"
+ "";
var errors = it.getErrorsAndWarnings().stream()
.filter(issue -> issue.getSeverity() == Severity.ERROR)
.collect(Collectors.toList());
if (!errors.isEmpty()) {
throw new IllegalStateException("One or more resources contained issues: " + errors);
}
it.assertNoErrors();
assertEquals(expectation, Strings.toUnixLineSeparator(it.getSingleGeneratedCode()));
it.getCompiledClass();
it.getCompiledClass(); // check that the generated Java code compiles
});
}
}

0 comments on commit 711984a

Please sign in to comment.