+
+ @Test
+ public void randomTest() {
+ for (int i=0; i<10000; i++) {
+ double orig = Math.random();
+ double result;
+ double expected = Math.rint(orig*100000) / 100000.0;
+
+ if (orig < 0.1)
+ continue;
+ String s = TextUtil.doubleToString(orig);
+ result = Double.parseDouble(s);
+ assertEquals(expected, result, 0.00000001);
+ }
+ }
+