Hacks similar to contest 2023 ones by EgorkaKulikov · Pull Request #2676 · UnitTestBot/UTBotJava · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,14 @@ abstract class CgAbstractRenderer(

val isBlockTooLarge = workaround(LONG_CODE_FRAGMENTS) { block.size > LARGE_CODE_BLOCK_SIZE }

if (isBlockTooLarge) {
print("/*")
println(" This block of code is ${block.size} lines long and could lead to compilation error")
}

withIndent {
for (statement in block) {
statement.accept(this)
if (!isBlockTooLarge) {
withIndent {
for (statement in block) {
statement.accept(this)
}
}
}

if (isBlockTooLarge) println("*/")

print("}")

if (printNextLine) println()
Expand Down Expand Up @@ -982,6 +977,6 @@ abstract class CgAbstractRenderer(
/**
* @see [LONG_CODE_FRAGMENTS]
*/
private const val LARGE_CODE_BLOCK_SIZE: Int = 1000
private const val LARGE_CODE_BLOCK_SIZE: Int = 150
}
}