Skip to content

Commit fea35e6

Browse files
committed
Add a testcase to reproduce #1657.
1 parent 97b5cc4 commit fea35e6

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2023 DiffPlug
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.diffplug.spotless.extra.groovy;
17+
18+
import org.junit.jupiter.api.Test;
19+
20+
import com.diffplug.spotless.StepHarness;
21+
import com.diffplug.spotless.TestProvisioner;
22+
23+
public class GrEclipseFormatterStepSpecialCaseTest {
24+
/** https://github.com/diffplug/spotless/issues/1657 */
25+
@Test
26+
public void issue_1657() {
27+
StepHarness.forStep(GrEclipseFormatterStep.createBuilder(TestProvisioner.mavenCentral()).build())
28+
.testResourceUnaffected("groovy/greclipse/format/SomeClass.test");
29+
}
30+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.somepackage
2+
3+
class SomeClass {
4+
5+
def func(parm) {
6+
"""<tag>
7+
${parm == null ? "" : "<tag>$parm</tag>"}
8+
${parm == null ? "" : "<tag>$parm</tag>"}
9+
</tag>
10+
"""
11+
}
12+
}

0 commit comments

Comments
 (0)