bbaldino
01/21/2020, 5:45 AM${...}
in the compiled test code? If I do:
val code = """
fun foo() {
println("The list is ${listOf(1, 2, 3)}"
}
""".trimIndent()
assertThat(subject.compileAndLintWithContext(wrapper.env, code)).hasSize(0)
then the compiled ktFile
has the list expanded, but if I do:
val code = """
fun foo() {
println("The list is \$\{listOf(1, 2, 3)\}"
}
""".trimIndent()
assertThat(subject.compileAndLintWithContext(wrapper.env, code)).hasSize(0)
then the compiled ktFile
maintains the escape characters, so the code isn't actually doing the expansionprintln("The list is ${listOf(1, 2, 3)}"
schalkms
01/21/2020, 7:51 PMcompileAndLint
functionality.bbaldino
01/21/2020, 7:52 PMcompileAndLint
(or some other helper function) existed to work around it in detektschalkms
01/23/2020, 6:27 PMbbaldino
01/23/2020, 6:27 PMArtur Bosch
01/27/2020, 8:35 AMbbaldino
01/27/2020, 6:00 PM.kt
file in resources or something, is there a form of compileAndLintWithContext
that takes in a file?Czar
01/28/2020, 2:29 PM${'$'}
instead of an escape?
val code = """
fun foo() {
println("The list is ${'$'}{listOf(1, 2, 3)}"
}
""".trimIndent()
bbaldino
01/28/2020, 5:39 PMschalkms
01/28/2020, 6:11 PMCzar
01/28/2020, 6:41 PM$
without resorting to ${'$'}
several messages above 😄