Skip to content

Commit 8f9f484

Browse files
maeryoMAERYO
andauthored
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]>
1 parent 407df7a commit 8f9f484

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ abstract class AbstractToolIntegrationTest : KotlinTestBase() {
289289
}
290290

291291
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 = '.' }
293293
val df = DecimalFormat(pattern, symbols).apply { isGroupingUsed = false }
294294
val formattedResult = df.format(result)
295295

@@ -482,7 +482,7 @@ abstract class AbstractToolIntegrationTest : KotlinTestBase() {
482482
"a" : 5.5,
483483
"b" : 2.0,
484484
"result" : 11.0,
485-
"formattedResult" : "11,000",
485+
"formattedResult" : "11.000",
486486
"precision" : 3,
487487
"tags" : ["test", "calculator", "integration"]
488488
}
@@ -633,7 +633,7 @@ abstract class AbstractToolIntegrationTest : KotlinTestBase() {
633633
"a": 0.0,
634634
"b": 0.0,
635635
"result": 0.0,
636-
"formattedResult": "0,00",
636+
"formattedResult": "0.00",
637637
"precision": 2,
638638
"tags": []
639639
}

0 commit comments

Comments
 (0)