-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update ProGuardCORE * Remove Java 20 from test list
- Loading branch information
1 parent
dda133e
commit aa1835f
Showing
5 changed files
with
48 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package proguard | ||
|
||
import io.kotest.core.spec.style.FreeSpec | ||
import io.kotest.matchers.shouldNotBe | ||
import proguard.testutils.ClassPoolBuilder | ||
import proguard.testutils.JavaSource | ||
import testutils.RequiresJavaVersion | ||
|
||
@RequiresJavaVersion(20, 20) | ||
class Java20RecordPatternTest : FreeSpec({ | ||
"Given a class with Java record pattern" - { | ||
val (programClassPool, _) = ClassPoolBuilder.fromSource( | ||
JavaSource( | ||
"Test.java", | ||
""" | ||
public class Test { | ||
public static void main(String[] args) { | ||
printPoint(new Point(1, 2)); | ||
} | ||
|
||
private static void printPoint(Object o) { | ||
if (o instanceof Point(int x, int y)) { | ||
System.out.println(x + y); | ||
} | ||
} | ||
} | ||
record Point(int x, int y) {} | ||
""".trimIndent() | ||
), | ||
javacArguments = listOf("--enable-preview", "--release", "20") | ||
) | ||
|
||
"Then ProGuard should parse the class correctly" { | ||
programClassPool.getClass("Test") shouldNotBe null | ||
programClassPool.getClass("Point") shouldNotBe null | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters