-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set compliance level to 19, add test cases for record classes and swi…
…tch expressions Note that support for Java 20 and 21 is not yet added to Spoon.
- Loading branch information
1 parent
62e94ff
commit 016c78e
Showing
6 changed files
with
34 additions
and
1 deletion.
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
4 changes: 4 additions & 0 deletions
4
src/test/resources/representer/RepresenterTest.testRepresentation.record-class.approved.txt
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,4 @@ | ||
record PLACEHOLDER_01(java.lang.String field) { | ||
void PLACEHOLDER_03(int PLACEHOLDER_06) { | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...t/resources/representer/RepresenterTest.testRepresentation.switch-expression.approved.txt
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,12 @@ | ||
class PLACEHOLDER_01 { | ||
int PLACEHOLDER_02(java.lang.String PLACEHOLDER_03) { | ||
return switch (PLACEHOLDER_03) { | ||
case "Lord of the Rings" -> | ||
5; | ||
case "Harry Potter" -> | ||
4; | ||
default -> | ||
-1; | ||
}; | ||
} | ||
} |
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,4 @@ | ||
record Record(String field) { | ||
void method(int argument) { | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/resources/scenarios/switch-expression/SwitchExpression.java
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,9 @@ | ||
class SwitchExpression { | ||
int rate(String book) { | ||
return switch (book) { | ||
case "Lord of the Rings" -> 5; | ||
case "Harry Potter" -> 4; | ||
default -> -1; | ||
}; | ||
} | ||
} |