You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2019/06/18 13:16:48 UTC
[commons-numbers] 03/34: Restore relevant changes overwritten in
the merge of the master branch
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
commit 5f7f230895b985231267abb88727cbd622a5665d
Author: Schamschi <he...@gmx.at>
AuthorDate: Fri Jun 7 12:20:40 2019 +0200
Restore relevant changes overwritten in the merge of the master branch
---
.../org/apache/commons/numbers/fraction/BigFractionTest.java | 12 ++++++------
.../org/apache/commons/numbers/fraction/FractionTest.java | 7 ++++---
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
index 2234b1b..671164d 100644
--- a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
+++ b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/BigFractionTest.java
@@ -88,11 +88,11 @@ public class BigFractionTest {
}
}
- @Test()
+ @Test
public void testGoldenRatio() {
// the golden ratio is notoriously a difficult number for continuous fraction
Assertions.assertThrows(FractionException.class,
- () -> new BigFraction((1 + Math.sqrt(5)) / 2, 1.0e-12, 25)
+ () -> BigFraction.from((1 + Math.sqrt(5)) / 2, 1.0e-12, 25)
);
}
@@ -159,18 +159,18 @@ public class BigFractionTest {
}
// MATH-1029
- @Test()
+ @Test
public void testPositiveValueOverflow() {
Assertions.assertThrows(ArithmeticException.class,
- () -> assertFraction((long) 1e10, 1, new BigFraction(1e10, 1000))
+ () -> assertFraction((long) 1e10, 1, BigFraction.from(1e10, 1000))
);
}
// MATH-1029
- @Test()
+ @Test
public void testNegativeValueOverflow() {
Assertions.assertThrows(ArithmeticException.class,
- () -> assertFraction((long) -1e10, 1, new BigFraction(-1e10, 1000))
+ () -> assertFraction((long) -1e10, 1, BigFraction.from(-1e10, 1000))
);
}
diff --git a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java
index 444f2ef..557895e 100644
--- a/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java
+++ b/commons-numbers-fraction/src/test/java/org/apache/commons/numbers/fraction/FractionTest.java
@@ -62,11 +62,11 @@ public class FractionTest {
assertFraction(15, 1, Fraction.from(15.0000000000001));
}
- @Test()
+ @Test
public void testGoldenRatio() {
// the golden ratio is notoriously a difficult number for continuous fraction
Assertions.assertThrows(ArithmeticException.class,
- () -> new Fraction((1 + Math.sqrt(5)) / 2, 1.0e-12, 25)
+ () -> Fraction.from((1 + Math.sqrt(5)) / 2, 1.0e-12, 25)
);
}
@@ -644,7 +644,8 @@ public class FractionTest {
};
int inc = 0;
for (Fraction fraction: fractions) {
- Assert.assertEquals(fraction,Fraction.parse(validExpressions[inc]));
+ Assert.assertEquals(fraction,
+ Fraction.parse(validExpressions[inc]));
inc++;
}
}