MCPcopy Create free account
hub / github.com/careercup/ctci / test

Method test

java/Chapter 17/Question17_5/Question.java:133–142  ·  view source on GitHub ↗
(String guess, String solution)

Source from the content-addressed store, hash-verified

131 }
132
133 public static boolean test(String guess, String solution) {
134 Result res1 = estimate(guess, solution);
135 Result res2 = estimateBad(guess, solution);
136 if (res1.hits == res2.hits && res1.pseudoHits == res2.pseudoHits) {
137 return true;
138 } else {
139 System.out.println("FAIL: (" + guess + ", " + solution + "): " + res1.toString() + " | " + res2.toString());
140 return false;
141 }
142 }
143
144 public static boolean testRandom() {
145 String guess = randomString();

Callers 2

testRandomMethod · 0.95
mainMethod · 0.95

Calls 4

estimateMethod · 0.95
estimateBadMethod · 0.95
toStringMethod · 0.95
testRandomMethod · 0.95

Tested by

no test coverage detected