Skip to content

Commit 50c0741

Browse files
committed
Add newlines to the big list literal in 'ListComprehensionBenchmark'
Having a too long list literal caused column number to overflow (they are stored in a "short" value).
1 parent 7c7021d commit 50c0741

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lkql_jit/benchmarks/src/test/java/com/adacore/lkql_jit/benchmarks/ListComprehensionBenchmark.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public class ListComprehensionBenchmark extends TruffleBenchmark {
3131
/** The source for the LKQL list comprehension value. */
3232
private static final String lkqlSource =
3333
"""
34-
val generator = %s
34+
val generator = [%s]
3535
val result = [x * 2 for x in generator].to_list
3636
""";
3737

3838
/** The fibonacci function in JS */
3939
private static final String jsSource =
4040
"""
41-
var generator = %s;
41+
var generator = [%s];
4242
var result = generator.map(x => x * 2);
4343
""";
4444

@@ -55,7 +55,9 @@ public void setup() {
5555
for (int i = 0; i < size; i++) {
5656
this.generator[i] = i;
5757
}
58-
final String generatorLiteral = Arrays.toString(this.generator);
58+
final String generatorLiteral =
59+
String.join(
60+
",\n", Arrays.stream(this.generator).mapToObj(Integer::toString).toList());
5961
this.lkqlListComp = lkqlSource.formatted(generatorLiteral);
6062
this.jsListComp = jsSource.formatted(generatorLiteral);
6163
}

0 commit comments

Comments
 (0)