Added test case to ensure nextPermutation fails for negative arguments.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_0@719993 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0a19478d2d
commit
9b8d0da71a
|
@ -589,7 +589,16 @@ public class RandomDataTest extends RetryTestCase {
|
|||
fail("permutation k = n = 0, expecting IllegalArgumentException");
|
||||
} catch (IllegalArgumentException ex) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we fail for k < n < 0
|
||||
try {
|
||||
perm = randomData.nextPermutation(-1,-3);
|
||||
fail("permutation k < n < 0, expecting IllegalArgumentException");
|
||||
} catch (IllegalArgumentException ex) {
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue