From a69ce3c730c0bada6c704000a7336ead609de6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Sun, 3 Nov 2024 21:24:47 +0100 Subject: [PATCH] Failing test for #4615 --- rewrite-gradle/build.gradle.kts | 1 + .../org/openrewrite/gradle/GradleParserTest.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/rewrite-gradle/build.gradle.kts b/rewrite-gradle/build.gradle.kts index 9f18146b3b0..02161d221fb 100644 --- a/rewrite-gradle/build.gradle.kts +++ b/rewrite-gradle/build.gradle.kts @@ -58,6 +58,7 @@ dependencies { // because gradle-api fatjars this implementation already exclude("ch.qos.logback", "logback-classic") } + testImplementation("org.junit-pioneer:junit-pioneer:2.0.0") testImplementation("org.openrewrite.gradle.tooling:model:$latest") diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/GradleParserTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/GradleParserTest.java index 7ffb40fcc46..a710f3ecc42 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/GradleParserTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/GradleParserTest.java @@ -15,7 +15,9 @@ */ package org.openrewrite.gradle; +import org.junitpioneer.jupiter.ExpectedToFail; import org.junit.jupiter.api.Test; +import org.openrewrite.Issue; import org.openrewrite.java.tree.J; import org.openrewrite.test.RewriteTest; @@ -188,4 +190,17 @@ void handleImportsThatArentTheFirstStatement() { ) ); } + + @Issue("https://github.com/openrewrite/rewrite/issues/4615") + @ExpectedToFail + @Test + void parensAroundAnExpression() { + rewriteRun( + buildGradle( + """ + def version = (rootProject.jobName.startsWith('a')) ? "latest.release" : "3.0" + """ + ) + ); + } }