()
| 135 | } |
| 136 | |
| 137 | static void test_6() { |
| 138 | System.out.print("test 6..."); |
| 139 | Variable X = new Variable("X"); |
| 140 | Query q6 = new Query("p", new Term[] { X, X }); |
| 141 | Term[] x_target = new Term[] { a }; |
| 142 | Map<String, Term>[] solutions = q6.allSolutions(); |
| 143 | if (solutions.length != 1) { |
| 144 | System.out.println("p(X, X) failed:"); |
| 145 | System.out.println("\tExpected: 1 solution"); |
| 146 | System.out.println("\tGot: " + solutions.length); |
| 147 | // System.exit(1); |
| 148 | } |
| 149 | for (int i = 0; i < solutions.length; ++i) { |
| 150 | Object x_binding = solutions[i].get("X"); |
| 151 | if (!x_binding.equals(x_target[i])) { |
| 152 | System.out.println("p(X, X) failed:"); |
| 153 | System.out.println("\tExpected: " + x_target[i]); |
| 154 | System.out.println("\tGot: " + x_binding); |
| 155 | // System.exit(1); |
| 156 | } |
| 157 | } |
| 158 | System.out.println("passed"); |
| 159 | } |
| 160 | |
| 161 | static void test_7() { |
| 162 | System.out.print("test 7..."); |
no test coverage detected