Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkerford committed Oct 22, 2024
1 parent 8468b20 commit f4a2a38
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,44 @@ class A {
);
}

@Test
void enumCollidesWithNewStringLiteral() {
rewriteRun(
//language=java
java(
"""
package org.foo;
enum TYPES {
VALUE, NUMBER, TEXT
}
class A {
final String val1 = "types";
final String val2 = "types";
final String val3 = "types";
TYPES type = TYPES.VALUE;
}
""",
"""
package org.foo;
enum TYPES {
VALUE, NUMBER, TEXT
}
class A {
private static final String TYPES_1 = "types";
final String val1 = TYPES_1;
final String val2 = TYPES_1;
final String val3 = TYPES_1;
TYPES type = TYPES.VALUE;
}
"""
)
);
}

@Test
void fieldNameCollidesWithNewStringLiteral() {
rewriteRun(
Expand Down

0 comments on commit f4a2a38

Please sign in to comment.