diff options
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVTypeCastSuite.scala | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVTypeCastSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVTypeCastSuite.scala index 40c5ccd0f7..c28a25057e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVTypeCastSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVTypeCastSuite.scala @@ -90,9 +90,14 @@ class CSVTypeCastSuite extends SparkFunSuite { } test("Float and Double Types are cast correctly with Locale") { - val locale : Locale = new Locale("fr", "FR") - Locale.setDefault(locale) - assert(CSVTypeCast.castTo("1,00", FloatType) == 1.0) - assert(CSVTypeCast.castTo("1,00", DoubleType) == 1.0) + val originalLocale = Locale.getDefault + try { + val locale : Locale = new Locale("fr", "FR") + Locale.setDefault(locale) + assert(CSVTypeCast.castTo("1,00", FloatType) == 1.0) + assert(CSVTypeCast.castTo("1,00", DoubleType) == 1.0) + } finally { + Locale.setDefault(originalLocale) + } } } |