Fix test that was failing on Windows

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@988777 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
William Barker 2010-08-25 01:23:20 +00:00
parent 95ebe8294c
commit f119c3a547
1 changed files with 11 additions and 10 deletions

View File

@ -87,16 +87,17 @@ public class MultivariateSummaryStatisticsTest extends TestCase {
stats.addValue(new double[] {3, 1});
Locale d = Locale.getDefault();
Locale.setDefault(Locale.US);
assertEquals("MultivariateSummaryStatistics:\n" +
"n: 3\n" +
"min: 1.0, 1.0\n" +
"max: 3.0, 3.0\n" +
"mean: 2.0, 2.0\n" +
"geometric mean: 1.817..., 1.817...\n" +
"sum of squares: 14.0, 14.0\n" +
"sum of logarithms: 1.791..., 1.791...\n" +
"standard deviation: 1.0, 1.0\n" +
"covariance: Array2DRowRealMatrix{{1.0,-1.0},{-1.0,1.0}}\n",
final String suffix = System.getProperty("line.separator");
assertEquals("MultivariateSummaryStatistics:" + suffix+
"n: 3" +suffix+
"min: 1.0, 1.0" +suffix+
"max: 3.0, 3.0" +suffix+
"mean: 2.0, 2.0" +suffix+
"geometric mean: 1.817..., 1.817..." +suffix+
"sum of squares: 14.0, 14.0" +suffix+
"sum of logarithms: 1.791..., 1.791..." +suffix+
"standard deviation: 1.0, 1.0" +suffix+
"covariance: Array2DRowRealMatrix{{1.0,-1.0},{-1.0,1.0}}" +suffix,
stats.toString().replaceAll("([0-9]+\\.[0-9][0-9][0-9])[0-9]+", "$1..."));
Locale.setDefault(d);
}