提交 a56a554a authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use Locale.US for String.format() in TestFunctions

上级 81aee733
...@@ -1497,7 +1497,7 @@ public class TestFunctions extends TestBase implements AggregateFunction { ...@@ -1497,7 +1497,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
assertResult("1979-11-12 08:12:34.56", stat, "SELECT X FROM T"); assertResult("1979-11-12 08:12:34.56", stat, "SELECT X FROM T");
assertResult("-100-01-15 14:04:02.12", stat, "SELECT X FROM U"); assertResult("-100-01-15 14:04:02.12", stat, "SELECT X FROM U");
String expected = String.format("%tb", timestamp1979).toUpperCase(); String expected = String.format(Locale.US, "%tb", timestamp1979).toUpperCase();
assertResult("12-" + expected + "-79 08.12.34.560000 AM", stat, assertResult("12-" + expected + "-79 08.12.34.560000 AM", stat,
"SELECT TO_CHAR(X) FROM T"); "SELECT TO_CHAR(X) FROM T");
assertResult("- / , . ; : text - /", stat, assertResult("- / , . ; : text - /", stat,
...@@ -1617,7 +1617,7 @@ public class TestFunctions extends TestBase implements AggregateFunction { ...@@ -1617,7 +1617,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
assertResult("11", stat, "SELECT TO_CHAR(X, 'Mm') FROM T"); assertResult("11", stat, "SELECT TO_CHAR(X, 'Mm') FROM T");
assertResult("11", stat, "SELECT TO_CHAR(X, 'mM') FROM T"); assertResult("11", stat, "SELECT TO_CHAR(X, 'mM') FROM T");
assertResult("11", stat, "SELECT TO_CHAR(X, 'mm') FROM T"); assertResult("11", stat, "SELECT TO_CHAR(X, 'mm') FROM T");
expected = String.format("%1$tb", timestamp1979); expected = String.format(Locale.US, "%1$tb", timestamp1979);
expected = expected.substring(0, 1).toUpperCase() + expected.substring(1); expected = expected.substring(0, 1).toUpperCase() + expected.substring(1);
assertResult(expected.toUpperCase(), stat, assertResult(expected.toUpperCase(), stat,
"SELECT TO_CHAR(X, 'MON') FROM T"); "SELECT TO_CHAR(X, 'MON') FROM T");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论