-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: JEP 445: Unnamed Classes and Instance Main Methods (#1633)
* feat: JEP 445: Unnamed Classes and Instance Main Methods * fix: try avoid encoding issue in choco build
- Loading branch information
1 parent
ac432ec
commit 9c2255b
Showing
10 changed files
with
61 additions
and
5 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,20 @@ | ||
Feature: jep445 | ||
|
||
Background: | ||
// as long as java 21 is not downloadable | ||
// we keep this abort in place - it should be removed | ||
// until then test by: | ||
// JBANG_JDK_VENDOR=openjdk ./karate.java jep445.feature | ||
* if (java.lang.System.getenv('JBANG_JDK_VENDOR') != "openjdk") karate.abort() | ||
|
||
Scenario: naked main | ||
When command('jbang nakedmain/noclass.java') | ||
Then match out == "Hello!\n" | ||
|
||
Scenario: naked main | ||
When command('jbang nakedmain/noclasswithargs.java hey') | ||
Then match out == "Hello hey\n" | ||
|
||
Scenario: naked main | ||
When command('jbang nakedmain/classinstance.java yo') | ||
Then match out == "Hello yo\n" |
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,8 @@ | ||
//JAVA 21+ | ||
//PREVIEW | ||
class classinstance { | ||
void main(String... args) { | ||
|
||
System.out.println("Hello " + args[0]); | ||
} | ||
} |
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,6 @@ | ||
//JAVA 21+ | ||
//PREVIEW | ||
|
||
void main() { | ||
System.out.println("Hello!"); | ||
} |
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,6 @@ | ||
//JAVA 21+ | ||
//PREVIEW | ||
|
||
void main(String... args) { | ||
System.out.println("Hello " + args[0]); | ||
} |
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
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