MCPcopy Create free account
hub / github.com/SWI-Prolog/packages-jpl / test_6

Method test_6

src/examples/java/test/Test.java:137–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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...");

Callers 1

run_testsMethod · 0.95

Calls 2

allSolutionsMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected