Skip to content

Commit

Permalink
Merge pull request #50 from tieskedh/fix/lazyIfTest
Browse files Browse the repository at this point in the history
lazy iftest didn't test
  • Loading branch information
tieskedh authored Jun 28, 2019
2 parents 5d57fb1 + 43fb4f8 commit f1a579b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/test/kotlin/nl/devhaan/kotlinpoetdsl/codeblock/IfTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,26 @@ class IfTest : StringSpec({
statement("""println(2)""")
}.end()
}
}.println()
}.toString() shouldBe
"""|when(1) {
| 1 -> if (1==1) {
| println(1)
| }
| 2 -> if ((null) == true) {
| println("won't print, it's not positive")
| } else if ((null) == false) {
| println("won't print, it's not negative")
| } else if ((null) == true) {
| println("well this is stupid code")
| } else {
| println("finally, smth to print")
| }
| 3 -> if ((null) == false) {
| println("won't print, it's not positive")
| } else if (true) {
| println(2)
| }
|}
|""".trimMargin()
}
})

0 comments on commit f1a579b

Please sign in to comment.