Make examples runnable
* Also drop args from fun main
diff --git a/core/kotlinx-coroutines-core/test/guide/example-cancel-07.kt b/core/kotlinx-coroutines-core/test/guide/example-cancel-07.kt
index 4596c30..3fbbd09 100644
--- a/core/kotlinx-coroutines-core/test/guide/example-cancel-07.kt
+++ b/core/kotlinx-coroutines-core/test/guide/example-cancel-07.kt
@@ -7,7 +7,8 @@
import kotlinx.coroutines.*
-fun main(args: Array<String>) = runBlocking {
+fun main() = runBlocking {
+//sampleStart
val result = withTimeoutOrNull(1300L) {
repeat(1000) { i ->
println("I'm sleeping $i ...")
@@ -16,4 +17,5 @@
"Done" // will get cancelled before it produces this result
}
println("Result is $result")
+//sampleEnd
}