File tree Expand file tree Collapse file tree 5 files changed +54
-0
lines changed Expand file tree Collapse file tree 5 files changed +54
-0
lines changed 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+ // This file was automatically generated from example-basic.in.md by Knit tool. Do not edit.
2+ package com.example.exampleClear01
3+
4+ fun main () {
5+ println (" Hello, world!" )
6+ }
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
You can’t perform that action at this time.
0 commit comments