Skip to content

Commit 2d73525

Browse files
committed
fixup! Introduce Kotlin integration tests
1 parent f2b708b commit 2d73525

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/typescript/TypeScriptEdgeCasesTest.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ class TypeScriptEdgeCasesTest : TypeScriptTestBase() {
6464
fun testSpecialCharacters() {
6565
val specialChars = "!@#$+-[].,?"
6666

67-
val tempFile = File(tsClientDir, "special_chars.txt")
67+
val tempFile = File.createTempFile("special_chars", ".txt")
6868
tempFile.writeText(specialChars)
69+
tempFile.deleteOnExit()
6970

70-
val specialCharsCommand = "npx tsx myClient.ts $serverUrl greet \"$(cat special_chars.txt)\""
71+
val specialCharsContent = tempFile.readText()
72+
val specialCharsCommand = "npx tsx myClient.ts $serverUrl greet \"$specialCharsContent\""
7173
val specialCharsOutput = executeCommand(specialCharsCommand, tsClientDir)
7274

73-
tempFile.delete()
74-
7575
assertTrue(
7676
specialCharsOutput.contains("Hello, $specialChars!"),
7777
"Tool should handle special characters in arguments"
@@ -81,16 +81,17 @@ class TypeScriptEdgeCasesTest : TypeScriptTestBase() {
8181
"Client should disconnect cleanly after handling special characters"
8282
)
8383
}
84-
8584
@Test
8685
@Timeout(30, unit = TimeUnit.SECONDS)
8786
fun testLargePayload() {
8887
val largeName = "A".repeat(10 * 1024)
8988

90-
val tempFile = File(tsClientDir, "large_name.txt")
89+
val tempFile = File.createTempFile("large_name", ".txt")
9190
tempFile.writeText(largeName)
91+
tempFile.deleteOnExit()
9292

93-
val largePayloadCommand = "npx tsx myClient.ts $serverUrl greet \"$(cat large_name.txt)\""
93+
val largeNameContent = tempFile.readText()
94+
val largePayloadCommand = "npx tsx myClient.ts $serverUrl greet \"$largeNameContent\""
9495
val largePayloadOutput = executeCommand(largePayloadCommand, tsClientDir)
9596

9697
tempFile.delete()

0 commit comments

Comments
 (0)