mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-12 13:05:06 +00:00
Factor out number failure tests
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1461685 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0b58bbef33
commit
a1d5af1297
@ -231,14 +231,12 @@ public void testCreateNumber() {
|
||||
final Number bigNum = NumberUtils.createNumber("-1.1E-700F");
|
||||
assertNotNull(bigNum);
|
||||
assertEquals(BigDecimal.class, bigNum.getClass());
|
||||
}
|
||||
|
||||
// Check that the code fails to create a valid number when preceeded by -- rather than -
|
||||
try {
|
||||
NumberUtils.createNumber("--1.1E-700F");
|
||||
fail("Expected NumberFormatException");
|
||||
} catch (final NumberFormatException nfe) {
|
||||
// expected
|
||||
}
|
||||
@Test(expected=NumberFormatException.class)
|
||||
// Check that the code fails to create a valid number when preceeded by -- rather than -
|
||||
public void testCreateNumberFailure_1() {
|
||||
NumberUtils.createNumber("--1.1E-700F");
|
||||
}
|
||||
|
||||
// Tests to show when magnitude causes switch to next Number type
|
||||
|
Loading…
x
Reference in New Issue
Block a user