Skip to content

Commit bca98f4

Browse files
committed
Reknit guide, fixed TOC in Knit with comma & verify mode in example-context-09
1 parent 3de2be4 commit bca98f4

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

core/kotlinx-coroutines-core/test/guide/test/GuideTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ class GuideTest {
294294

295295
@Test
296296
fun testKotlinxCoroutinesExperimentalGuideContext09() {
297-
test("KotlinxCoroutinesExperimentalGuideContext09") { kotlinx.coroutines.experimental.guide.context09.main(emptyArray()) }.verifyLines(
297+
test("KotlinxCoroutinesExperimentalGuideContext09") { kotlinx.coroutines.experimental.guide.context09.main(emptyArray()) }.verifyLinesFlexibleThread(
298298
"I'm working in thread CommonPool-worker-1 @test#2"
299299
)
300300
}

coroutines-guide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fun main(args: Array<String>) = runBlocking<Unit> {
360360

361361
// this is your first suspending function
362362
suspend fun launchDoWorld() = currentScope {
363-
launch {
363+
launch {
364364
println("World!")
365365
}
366366
}
@@ -1394,7 +1394,7 @@ The output of this code with `-Dkotlinx.coroutines.debug` JVM option is:
13941394
I'm working in thread CommonPool-worker-1 @test#2
13951395
```
13961396

1397-
<!--- TEST -->
1397+
<!--- TEST FLEXIBLE_THREAD -->
13981398

13991399
### Cancellation via explicit job
14001400

knit/src/Knit.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,11 @@ private fun requireSingleLine(directive: Directive) {
324324
require(directive.singleLine) { "${directive.name} directive must end on the same line with '$DIRECTIVE_END'" }
325325
}
326326

327-
fun makeSectionRef(name: String): String = name.replace(' ', '-').replace(".", "").toLowerCase()
327+
fun makeSectionRef(name: String): String = name
328+
.replace(' ', '-')
329+
.replace(".", "")
330+
.replace(",", "")
331+
.toLowerCase()
328332

329333
class Include(val regex: Regex, val lines: MutableList<String> = arrayListOf())
330334

0 commit comments

Comments
 (0)