Break infinity loop in the test
This commit is contained in:
@@ -13,12 +13,16 @@ fun box(): String {
|
|||||||
var counter: Int? = null
|
var counter: Int? = null
|
||||||
fun path(metaRunnerId: String) = counter != 2
|
fun path(metaRunnerId: String) = counter != 2
|
||||||
|
|
||||||
|
var i = 0
|
||||||
while (true) {
|
while (true) {
|
||||||
val name = projectId + "_" + it.id + (if (counter == null) "" else "_$counter")
|
val name = projectId + "_" + it.id + (if (counter == null) "" else "_$counter")
|
||||||
if (!path(name)) {
|
if (!path(name)) {
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
counter++
|
counter++
|
||||||
|
|
||||||
|
i++
|
||||||
|
if (i > 2) return "Infinity loop: $counter"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val X = selectMetaRunnerId()
|
val X = selectMetaRunnerId()
|
||||||
|
|||||||
Reference in New Issue
Block a user