Skip to content

Commit 9d4f23e

Browse files
committed
Update RandomIndexerSampleTests.java
#109 Prior test case adjustments still didn't quite solve issue (sporadically missing a branch). If this latest adjustment to test case doesn't consistently cover the branches of the helper of nextWindowedIntTriple, then there might be something going on with the method itself.
1 parent 7346b51 commit 9d4f23e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/org/cicirello/math/rand/RandomIndexerSampleTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,10 +1455,10 @@ public void testNextWindowedIntTriple_SR() {
14551455
assertEquals(2, result[2]);
14561456
}
14571457

1458-
// With n=100 and w=n-1, approximately 97% of the following samples should
1458+
// With n=1000 and w=n-1, approximately 99.7% of the following samples should
14591459
// go through the alternate path from above. That alternate path has
1460-
// 6 potential subpaths, all approximately equally likely.
1461-
int n = 100;
1460+
// 3 potential subpaths, all approximately equally likely.
1461+
int n = 1000;
14621462
int w = n-1;
14631463
for (int i = 0; i < 30; i++) {
14641464
int[] result = RandomIndexer.nextWindowedIntTriple(n, w, null, true, gen);

0 commit comments

Comments
 (0)