()
| 78 | } |
| 79 | |
| 80 | static void test_4() { |
| 81 | System.out.print("test 4..."); |
| 82 | Variable X = new Variable("X"); |
| 83 | Query q4 = new Query("p", new Term[] { X }); |
| 84 | Term[] target = new Term[] { a, f_a, pair_a_b, new Variable("_") }; |
| 85 | Map<String, Term>[] solutions = q4.allSolutions(); |
| 86 | if (solutions.length != 4) { |
| 87 | System.out.println("p(X) failed:"); |
| 88 | System.out.println("\tExpected: 4 solutions"); |
| 89 | System.out.println("\tGot: " + solutions.length); |
| 90 | // System.exit(1); |
| 91 | } |
| 92 | for (int i = 0; i < solutions.length - 1; ++i) { |
| 93 | Term binding = solutions[i].get("X"); |
| 94 | if (!binding.equals(target[i])) { |
| 95 | System.out.println("p(X) failed"); |
| 96 | System.out.println("\tExpected: " + target[i]); |
| 97 | System.out.println("\tGot: " + binding); |
| 98 | // System.exit(1); |
| 99 | } |
| 100 | } |
| 101 | System.out.println("passed"); |
| 102 | } |
| 103 | |
| 104 | static void test_5() { |
| 105 | System.out.print("test 5..."); |
no test coverage detected