File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
testlib/src/main/resources/groovy/greclipse/format Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .diffplug .spotless .extra .groovy ;
17
17
18
+ import org .junit .jupiter .api .Assertions ;
18
19
import org .junit .jupiter .api .Test ;
19
20
20
21
import com .diffplug .spotless .StepHarness ;
21
22
import com .diffplug .spotless .TestProvisioner ;
22
23
23
24
public class GrEclipseFormatterStepSpecialCaseTest {
24
- /** https://github.com/diffplug/spotless/issues/1657 */
25
+ /**
26
+ * https://github.com/diffplug/spotless/issues/1657
27
+ *
28
+ * broken: ${parm == null ? "" : "<tag>$parm</tag>"}
29
+ * works: ${parm == null ? "" : "<tag>parm</tag>"}
30
+ */
25
31
@ Test
26
32
public void issue_1657 () {
33
+ Assertions .assertThrows (IllegalArgumentException .class , () -> {
34
+ StepHarness .forStep (GrEclipseFormatterStep .createBuilder (TestProvisioner .mavenCentral ()).build ())
35
+ .testResourceUnaffected ("groovy/greclipse/format/SomeClass.test" );
36
+ });
37
+ }
38
+
39
+ @ Test
40
+ public void issue_1657_fixed () {
27
41
StepHarness .forStep (GrEclipseFormatterStep .createBuilder (TestProvisioner .mavenCentral ()).build ())
28
- .testResourceUnaffected ("groovy/greclipse/format/SomeClass.test " );
42
+ .testResourceUnaffected ("groovy/greclipse/format/SomeClass.fixed " );
29
43
}
30
44
}
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class SomeClass {
6
6
"""<tag>
7
7
${parm == null ? "" : "<tag>$parm</tag>"}
8
8
${parm == null ? "" : "<tag>$parm</tag>"}
9
- </tag>
9
+ </tag>
10
10
"""
11
11
}
12
12
}
You can’t perform that action at this time.
0 commit comments