forked from jhipster/prettier-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test for Unnamed Class Compilation Unit printing
- Loading branch information
1 parent
2b42563
commit 9e2cd48
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
packages/prettier-plugin-java/test/unit-test/unnamed-class-compilation-unit/_input.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,12 @@ | ||
import com.toto.titi.Test; | ||
import com.toto.titi.Toast; | ||
|
||
class TestClass { static String greetings() { return "Hello world!"; } } | ||
interface TestInterface { default String greetings() { return "Hello world!"; } } | ||
|
||
; | ||
String greeting() { return "Hello, World!"; } | ||
|
||
void main() { | ||
System.out.println(Test.greeting()); | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/prettier-plugin-java/test/unit-test/unnamed-class-compilation-unit/_output.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,23 @@ | ||
import com.toto.titi.Test; | ||
import com.toto.titi.Toast; | ||
|
||
class TestClass { | ||
|
||
static String greetings() { | ||
return "Hello world!"; | ||
} | ||
} | ||
|
||
interface TestInterface { | ||
default String greetings() { | ||
return "Hello world!"; | ||
} | ||
} | ||
|
||
String greeting() { | ||
return "Hello, World!"; | ||
} | ||
|
||
void main() { | ||
System.out.println(Test.greeting()); | ||
} |
5 changes: 5 additions & 0 deletions
5
...java/test/unit-test/unnamed-class-compilation-unit/unnamed-class-compilation-unit-spec.ts
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,5 @@ | ||
import { testSample } from "../../test-utils"; | ||
|
||
describe("prettier-java: Unnamed Class Compilation Unit", () => { | ||
testSample(__dirname); | ||
}); |