Skip to content

Commit a7a041d

Browse files
committed
Add test
1 parent 2b06fe3 commit a7a041d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/client/StdioClientTransportTest.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,24 @@ class StdioClientTransportTest : BaseTransportTest() {
4545
process.waitFor()
4646
process.destroy()
4747
}
48+
49+
@Test
50+
fun `should ignore first output messages`() = runTest {
51+
val processBuilder = ProcessBuilder("/usr/bin/tee")
52+
val process = processBuilder.start()
53+
process.outputStream.write("Stdio server started".toByteArray())
54+
55+
val input = process.inputStream.asSource().buffered()
56+
val output = process.outputStream.asSink().buffered()
57+
58+
val client = StdioClientTransport(
59+
input = input,
60+
output = output,
61+
)
62+
63+
testClientRead(client)
64+
65+
process.waitFor()
66+
process.destroy()
67+
}
4868
}

0 commit comments

Comments
 (0)