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:
Phil Steitz 2008-11-23 14:57:44 +00:00
parent 0a19478d2d
commit 9b8d0da71a
1 changed files with 10 additions and 1 deletions

View File

@ -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) {
;
}
}
}