You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix decimal separator format in calculator tool tests (#315)
## Changes
- Updated `DecimalFormatSymbols` to use period as decimal separator
(Locale.US)
- Fixed test expectations in `testComplexInputSchemaTool`:
- `formattedResult`: `"11,000"` → `"11.000"`
- `tags`: Added actual test values `["test", "calculator",
"integration"]`
- Fixed test expectations in `testComplexNestedSchema`:
- `formattedResult`: `"0,00"` → `"0.00"`
## Motivation
1. **Standard Decimal Notation**: Using a comma as a decimal separator
could be confusing as it's commonly used for thousands separators in
many locales. Standardizing on the period (`.`) follows international
conventions and makes the output clearer.
2. **Test Data Correction**: During the Validate PR workflow for #289,
discovered that the `tags` array in the `expectedContent` variable of
`testComplexInputSchemaTool()` was incorrectly set to an empty array,
which didn't match the actual input values being tested.
---------
Co-authored-by: MAERYO <[email protected]>
Copy file name to clipboardExpand all lines: kotlin-sdk-test/src/jvmTest/kotlin/io/modelcontextprotocol/kotlin/sdk/integration/kotlin/AbstractToolIntegrationTest.kt
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -289,7 +289,7 @@ abstract class AbstractToolIntegrationTest : KotlinTestBase() {
289
289
}
290
290
291
291
val pattern =if (precision >0) "0."+"0".repeat(precision) else"0"
292
-
val symbols =DecimalFormatSymbols(Locale.US).apply { decimalSeparator =',' }
292
+
val symbols =DecimalFormatSymbols(Locale.US).apply { decimalSeparator ='.' }
293
293
val df =DecimalFormat(pattern, symbols).apply { isGroupingUsed =false }
294
294
val formattedResult = df.format(result)
295
295
@@ -482,7 +482,7 @@ abstract class AbstractToolIntegrationTest : KotlinTestBase() {
482
482
"a" : 5.5,
483
483
"b" : 2.0,
484
484
"result" : 11.0,
485
-
"formattedResult" : "11,000",
485
+
"formattedResult" : "11.000",
486
486
"precision" : 3,
487
487
"tags" : ["test", "calculator", "integration"]
488
488
}
@@ -633,7 +633,7 @@ abstract class AbstractToolIntegrationTest : KotlinTestBase() {
0 commit comments