MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / startLines

Method startLines

src/test/java/com/rtg/util/TestUtils.java:739–754  ·  view source on GitHub ↗

Compares the lines in two strings checking that the expected lines are prefixes of the actual lines. @param expected a string. @param actual a string. @param sort true iff the lines aer to be sorted before a comparison is done (use it if there is non-determinism in the order of the results) @return

(final String expected, final String actual, final boolean sort)

Source from the content-addressed store, hash-verified

737 * @return true if ll the expected lines are prefixes of the actual lines.
738 */
739 public static boolean startLines(final String expected, final String actual, final boolean sort) {
740 final String[] erecs = splitLines(expected.trim());
741 if (sort) {
742 Arrays.sort(erecs);
743 }
744 final String[] arecs = splitLines(actual.trim());
745 if (sort) {
746 Arrays.sort(arecs);
747 }
748 final boolean same = startLines(erecs, arecs);
749 if (!same) {
750 System.err.println("Actual output was:\n" + actual);
751 System.err.println("Expected output was:\n" + expected);
752 }
753 return same;
754 }
755
756 /**
757 * Checks whether the expected lines are prefixes of the actual lines.

Callers

nothing calls this directly

Calls 4

splitLinesMethod · 0.95
printlnMethod · 0.80
trimMethod · 0.65
sortMethod · 0.45

Tested by

no test coverage detected