aboutsummaryrefslogtreecommitdiffstats
path: root/kotlinx-coroutines-core/jvm/test/guide/test
diff options
context:
space:
mode:
Diffstat (limited to 'kotlinx-coroutines-core/jvm/test/guide/test')
-rw-r--r--kotlinx-coroutines-core/jvm/test/guide/test/BasicsGuideTest.kt46
-rw-r--r--kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt2
2 files changed, 12 insertions, 36 deletions
diff --git a/kotlinx-coroutines-core/jvm/test/guide/test/BasicsGuideTest.kt b/kotlinx-coroutines-core/jvm/test/guide/test/BasicsGuideTest.kt
index 765cd0b9..7e54fb1d 100644
--- a/kotlinx-coroutines-core/jvm/test/guide/test/BasicsGuideTest.kt
+++ b/kotlinx-coroutines-core/jvm/test/guide/test/BasicsGuideTest.kt
@@ -12,7 +12,7 @@ class BasicsGuideTest {
@Test
fun testExampleBasic01() {
test("ExampleBasic01") { kotlinx.coroutines.guide.exampleBasic01.main() }.verifyLines(
- "Hello,",
+ "Hello",
"World!"
)
}
@@ -20,7 +20,7 @@ class BasicsGuideTest {
@Test
fun testExampleBasic02() {
test("ExampleBasic02") { kotlinx.coroutines.guide.exampleBasic02.main() }.verifyLines(
- "Hello,",
+ "Hello",
"World!"
)
}
@@ -28,7 +28,7 @@ class BasicsGuideTest {
@Test
fun testExampleBasic03() {
test("ExampleBasic03") { kotlinx.coroutines.guide.exampleBasic03.main() }.verifyLines(
- "Hello,",
+ "Hello",
"World!"
)
}
@@ -36,50 +36,26 @@ class BasicsGuideTest {
@Test
fun testExampleBasic04() {
test("ExampleBasic04") { kotlinx.coroutines.guide.exampleBasic04.main() }.verifyLines(
- "Hello,",
- "World!"
+ "Hello",
+ "World 1",
+ "World 2",
+ "Done"
)
}
@Test
fun testExampleBasic05() {
test("ExampleBasic05") { kotlinx.coroutines.guide.exampleBasic05.main() }.verifyLines(
- "Hello,",
- "World!"
+ "Hello",
+ "World!",
+ "Done"
)
}
@Test
fun testExampleBasic06() {
- test("ExampleBasic06") { kotlinx.coroutines.guide.exampleBasic06.main() }.verifyLines(
- "Task from coroutine scope",
- "Task from runBlocking",
- "Task from nested launch",
- "Coroutine scope is over"
- )
- }
-
- @Test
- fun testExampleBasic07() {
- test("ExampleBasic07") { kotlinx.coroutines.guide.exampleBasic07.main() }.verifyLines(
- "Hello,",
- "World!"
- )
- }
-
- @Test
- fun testExampleBasic08() {
- test("ExampleBasic08") { kotlinx.coroutines.guide.exampleBasic08.main() }.also { lines ->
+ test("ExampleBasic06") { kotlinx.coroutines.guide.exampleBasic06.main() }.also { lines ->
check(lines.size == 1 && lines[0] == ".".repeat(100_000))
}
}
-
- @Test
- fun testExampleBasic09() {
- test("ExampleBasic09") { kotlinx.coroutines.guide.exampleBasic09.main() }.verifyLines(
- "I'm sleeping 0 ...",
- "I'm sleeping 1 ...",
- "I'm sleeping 2 ..."
- )
- }
}
diff --git a/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt b/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt
index d6f1c21d..1a84fb94 100644
--- a/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt
+++ b/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt
@@ -57,7 +57,7 @@ class DispatcherGuideTest {
@Test
fun testExampleContext06() {
test("ExampleContext06") { kotlinx.coroutines.guide.exampleContext06.main() }.verifyLines(
- "job1: I run in GlobalScope and execute independently!",
+ "job1: I run in my own Job and execute independently!",
"job2: I am a child of the request coroutine",
"job1: I am not affected by cancellation of the request",
"main: Who has survived request cancellation?"