Skip to content

Commit abb3d99

Browse files
Greg Adamssambsnyd
Greg Adams
authored andcommitted
Add disabled reproduction unit test method for issue #405
1 parent 6960d96 commit abb3d99

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

rewrite-test/src/main/kotlin/org/openrewrite/java/tree/MethodDeclarationTest.kt

+24-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package org.openrewrite.java.tree
1717

1818
import org.assertj.core.api.Assertions.assertThat
1919
import org.junit.jupiter.api.Assertions.assertTrue
20+
import org.junit.jupiter.api.Disabled
2021
import org.junit.jupiter.api.Test
2122
import org.openrewrite.java.JavaParser
2223
import org.openrewrite.java.JavaTreeTest
@@ -27,7 +28,7 @@ interface MethodDeclarationTest : JavaTreeTest {
2728

2829
@Test
2930
fun default(jp: JavaParser) = assertParsePrintAndProcess(
30-
jp, CompilationUnit, """
31+
jp, CompilationUnit, """
3132
public @interface A {
3233
String foo() default "foo";
3334
}
@@ -36,7 +37,7 @@ interface MethodDeclarationTest : JavaTreeTest {
3637

3738
@Test
3839
fun constructor(jp: JavaParser) = assertParsePrintAndProcess(
39-
jp, CompilationUnit, """
40+
jp, CompilationUnit, """
4041
public class A {
4142
public A() { }
4243
}
@@ -45,7 +46,7 @@ interface MethodDeclarationTest : JavaTreeTest {
4546

4647
@Test
4748
fun typeArguments(jp: JavaParser) = assertParsePrintAndProcess(
48-
jp, Class, """
49+
jp, Class, """
4950
public <P, R> R foo(P p, String s, String... args) {
5051
return null;
5152
}
@@ -54,7 +55,7 @@ interface MethodDeclarationTest : JavaTreeTest {
5455

5556
@Test
5657
fun interfaceMethodDecl(jp: JavaParser) = assertParsePrintAndProcess(
57-
jp, CompilationUnit, """
58+
jp, CompilationUnit, """
5859
public interface A {
5960
String getName() ;
6061
}
@@ -63,31 +64,31 @@ interface MethodDeclarationTest : JavaTreeTest {
6364

6465
@Test
6566
fun throws(jp: JavaParser) = assertParsePrintAndProcess(
66-
jp, Class, """
67+
jp, Class, """
6768
public void foo() throws Exception { }
6869
"""
6970
)
7071

7172
@Test
7273
fun nativeModifier(jp: JavaParser) = assertParsePrintAndProcess(
73-
jp, Class, """
74+
jp, Class, """
7475
public native void foo();
7576
"""
7677
)
7778

7879
@Test
7980
fun methodWithSuffixMultiComment(jp: JavaParser) = assertParsePrintAndProcess(
80-
jp, Class, """
81+
jp, Class, """
8182
public void foo() { }/*Comments*/
8283
"""
8384
)
8485

8586
@Test
8687
fun hasModifier(jp: JavaParser) {
8788
val a = jp.parse(
88-
"""
89+
"""
8990
public class A {
90-
private static boolean foo() { return true; };
91+
private static boolean foo() { return true; }
9192
}
9293
"""
9394
)[0]
@@ -97,4 +98,18 @@ interface MethodDeclarationTest : JavaTreeTest {
9798
assertTrue(inv.hasModifier(J.Modifier.Type.Private))
9899
assertTrue(inv.hasModifier(J.Modifier.Type.Static))
99100
}
101+
102+
@Test()
103+
@Disabled("Issue #405")
104+
fun unicodeCharacterLiterals(jp: JavaParser) = assertParsePrintAndProcess(jp, CompilationUnit,
105+
"""
106+
public class A {
107+
private boolean isSockJsSpecialChar(char ch) {
108+
return (ch <= '\u001F') || (ch >= '\u200C' && ch <= '\u200F') ||
109+
(ch >= '\u2028' && ch <= '\u202F') || (ch >= '\u2060' && ch <= '\u206F') ||
110+
(ch >= '\uFFF0') || (ch >= '\uD800' && ch <= '\uDFFF');
111+
}
112+
}
113+
"""
114+
)
100115
}

0 commit comments

Comments
 (0)