@@ -29,6 +29,8 @@ val VARARGS = 10
29
29
val TARGET_MAIN = s " ${project.getBasedir()}/src-gen/main/java "
30
30
val TARGET_TEST = s " ${project.getBasedir()}/src-gen/test/java "
31
31
val CHARSET = java.nio.charset.StandardCharsets .UTF_8
32
+ val comment = " //"
33
+ val javadoc = " **"
32
34
33
35
/**
34
36
* ENTRY POINT
@@ -43,9 +45,6 @@ def run(): Unit = {
43
45
*/
44
46
def generateMainClasses (): Unit = {
45
47
46
- // Workaround: Use /$javadoc instead of /** in a StringContext when IntelliJ IDEA otherwise shows up errors in the editor
47
- val javadoc = " **"
48
-
49
48
genAPI()
50
49
genFunctions()
51
50
genTuples()
@@ -3186,9 +3185,9 @@ def generateTestClasses(): Unit = {
3186
3185
// should return memoized value of second apply()
3187
3186
$assertThat(memo.apply( ${(1 to i).gen(j => s " $j" )(" , " )})).isEqualTo(expected);
3188
3187
${(i > 0 ).gen(xs """
3189
- // should calculate new values when called subsequently with different parameters
3188
+ $comment should calculate new values when called subsequently with different parameters
3190
3189
$assertThat(memo.apply( ${(1 to i).gen(j => s " ${j + 1 } " )(" , " )})).isEqualTo( ${(1 to i).gen(j => s " ${j + 1 } " )(" + " )} + 1);
3191
- // should return memoized value of second apply() (for new value)
3190
+ $comment should return memoized value of second apply() (for new value)
3192
3191
$assertThat(memo.apply( ${(1 to i).gen(j => s " ${j + 1 } " )(" , " )})).isEqualTo( ${(1 to i).gen(j => s " ${j + 1 } " )(" + " )} + 1);
3193
3192
""" )}
3194
3193
}
@@ -3235,7 +3234,7 @@ def generateTestClasses(): Unit = {
3235
3234
assertThat(pf.isDefinedAt(0)).isTrue();
3236
3235
assertThat(pf.isDefinedAt(1)).isFalse();
3237
3236
assertThat(pf.apply(0)).isEqualTo("0");
3238
- assertThat(pf.apply(1)).isEqualTo("1"); // it is valid to return a value, even if isDefinedAt returns false
3237
+ assertThat(pf.apply(1)).isEqualTo("1"); $comment it is valid to return a value, even if isDefinedAt returns false
3239
3238
}
3240
3239
""" })}
3241
3240
@@ -3307,7 +3306,7 @@ def generateTestClasses(): Unit = {
3307
3306
$assertThrows( ${im.getType(" java.security.NoSuchAlgorithmException" )}.class, () -> {
3308
3307
$name$i<MessageDigest> digest = () -> ${im.getType(" java.security.MessageDigest" )}.getInstance("Unknown");
3309
3308
Function $i<MessageDigest> unchecked = digest.unchecked();
3310
- unchecked.apply(); // Look ma, we throw an undeclared checked exception!
3309
+ unchecked.apply(); $comment Look ma, we throw an undeclared checked exception!
3311
3310
});
3312
3311
}
3313
3312
@@ -3374,7 +3373,7 @@ def generateTestClasses(): Unit = {
3374
3373
public void shouldUncheckedThrowIllegalState() {
3375
3374
$assertThrows( ${im.getType(" java.security.NoSuchAlgorithmException" )}.class, () -> {
3376
3375
final Function $i< ${(1 to i).gen(j => " String" )(" , " )}, MessageDigest> unchecked = digest.unchecked();
3377
- unchecked.apply( ${toArgList(" Unknown" )}); // Look ma, we throw an undeclared checked exception!
3376
+ unchecked.apply( ${toArgList(" Unknown" )}); $comment Look ma, we throw an undeclared checked exception!
3378
3377
});
3379
3378
}
3380
3379
0 commit comments