465 prevIndex = currentIndex; |
465 prevIndex = currentIndex; |
466 } |
466 } |
467 } |
467 } |
468 |
468 |
469 /** |
469 /** |
|
470 * Ensures that a series of strings appear only once, in the generated output, |
|
471 * noting that, this test does not exhaustively check for all other possible |
|
472 * duplicates once one is found. |
|
473 * @param path the file to check |
|
474 * @param strings ensure each are unique |
|
475 */ |
|
476 public void checkUnique(String path, String... strings) { |
|
477 String fileString = readOutputFile(path); |
|
478 for (String s : strings) { |
|
479 int currentIndex = fileString.indexOf(s); |
|
480 checking(s + " at index " + currentIndex); |
|
481 if (currentIndex == -1) { |
|
482 failed(s + " not found."); |
|
483 continue; |
|
484 } |
|
485 int nextindex = fileString.indexOf(s, currentIndex + s.length()); |
|
486 if (nextindex == -1) { |
|
487 passed(s + " is unique"); |
|
488 } else { |
|
489 failed(s + " is not unique, found at " + nextindex); |
|
490 } |
|
491 } |
|
492 } |
|
493 |
|
494 /** |
470 * Compare a set of files in each of two directories. |
495 * Compare a set of files in each of two directories. |
471 * |
496 * |
472 * @param baseDir1 the directory containing the first set of files |
497 * @param baseDir1 the directory containing the first set of files |
473 * @param baseDir2 the directory containing the second set of files |
498 * @param baseDir2 the directory containing the second set of files |
474 * @param files the set of files to be compared |
499 * @param files the set of files to be compared |