Skip to content

Commit

Permalink
Prepare for 2023.3: Don't use JDK_X in tests (#5417)
Browse files Browse the repository at this point in the history
Recently, a new special language level X has been introduced to IntelliJ.
It's different from the other one, because it's an alway's preview level
(there's no non-preview version). Hence, we don't want to run a test
that distinguishes preview and non-preview on that particlar level.

JetBrains/intellij-community@89a73e9
  • Loading branch information
tpasternak authored Oct 3, 2023
1 parent cdffce8 commit b70c7d6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static class LanguageLevelWithPreview {
@NotNull
private static LanguageLevelWithPreview getLatestLevelWithPreview() {
return stream(LanguageLevel.values())
.filter(it -> it.getPreviewLevel() != null)
.filter(it -> it.getPreviewLevel() != null && !it.getPreviewLevel().name().endsWith("_X"))
.map(it -> new LanguageLevelWithPreview(it, it.getPreviewLevel()))
.max(Comparator.comparingInt(it -> it.stableLevel.toJavaVersion().feature))
.orElseThrow(() -> new RuntimeException("Test can't be run, no preview language levels found in this IntelliJ version"));
Expand Down

0 comments on commit b70c7d6

Please sign in to comment.