File tree Expand file tree Collapse file tree 7 files changed +69
-1
lines changed Expand file tree Collapse file tree 7 files changed +69
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ allprojects {
3636 implementation(" com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.1" )
3737 testImplementation(kotlin(" test-junit" ))
3838 }
39-
39+
4040 tasks.withType<KotlinCompile > {
4141 kotlinOptions.apply {
4242 languageVersion = " 1.4"
Original file line number Diff line number Diff line change @@ -294,6 +294,7 @@ fun KnitContext.knit(inputFile: File): Boolean {
294294 requireSingleLine(directive)
295295 require(directive.param.isEmpty()) { " $CLEAR_DIRECTIVE directive must not have parameters" }
296296 codeLines.clear()
297+ testLines.clear()
297298 continue @mainLoop
298299 }
299300 KNIT_DIRECTIVE -> {
Original file line number Diff line number Diff line change @@ -247,6 +247,17 @@ class TestDataTest {
247247 )
248248 }
249249
250+ // !!! AUTOMATICALLY GENERATED BY TestDataGen. DO NOT EDIT !!!
251+ @Test
252+ fun testTestClear () {
253+ verifyTestData(
254+ " TestClear" ,
255+ " testdata/test-clear.in.md" ,
256+ " testdata/test-clear.in.md" ,
257+ " testdata/test-clear.properties"
258+ )
259+ }
260+
250261 // !!! AUTOMATICALLY GENERATED BY TestDataGen. DO NOT EDIT !!!
251262 @Test
252263 fun testTestHidden () {
Original file line number Diff line number Diff line change 1+
2+ ``` kotlin
3+ fun main () {
4+ // this code should be cleared
5+ }
6+ ```
7+
8+ ``` text
9+ this text should be cleared
10+ ```
11+
12+ <!-- - CLEAR -->
13+ <!-- - TEST_NAME ClearTest -->
14+
15+ Here is some explanatory text
16+
17+ ``` kotlin
18+ fun main () {
19+ println (" Hello, world!" )
20+ }
21+ ```
22+
23+ > You can get the full code [ here] ( test-clear/example-clear-01.kt ) .
24+
25+ This code prints:
26+
27+ ``` text
28+ Hello, world!
29+ ```
30+
31+ <!-- - TEST -->
Original file line number Diff line number Diff line change 1+ knit.dir =test-clear/
2+ knit.package =com.example
3+
4+ test.dir =test-clear/test/
5+ test.package =com.example.test
Original file line number Diff line number Diff line change 1+ // This file was automatically generated from test-basic.in.md by Knit tool. Do not edit.
2+ package com.example.exampleBasic01
3+
4+ fun main () {
5+ println (" Hello, world!" )
6+ }
Original file line number Diff line number Diff line change 1+ // This file was automatically generated from test-basic.in.md by Knit tool. Do not edit.
2+ package com.example.test
3+
4+ import org.junit.Test
5+ import kotlinx.knit.test.*
6+
7+ class ClearTest {
8+ @Test
9+ fun testExampleBasic01 () {
10+ captureOutput(" ExampleClear01" ) { com.example.exampleClear01.main() }.verifyOutputLines(
11+ " Hello, world!"
12+ )
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments