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

Method test_8

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

Source from the content-addressed store, hash-verified

202 }
203
204 static void test_8() {
205 System.out.print("test 8...");
206 // Variable X = new Variable("X");
207 // Query query = new Query("r", new Term[] { new Compound("f", new Term[] { X, X }), X });
208 String t8 = "r(f(X,X), X)";
209 Map<String, Term>[] solutions = Query.allSolutions(t8);
210 if (solutions.length != 2) {
211 System.out.println(t8 + " failed:");
212 System.out.println("\tExpected: 2 solutions");
213 System.out.println("\tGot: " + solutions.length);
214 // System.exit(1);
215 }
216 System.out.println("passed");
217 }
218
219 // corresponds with Prolog List: [a-a,a-b]
220 static Term test_9_solution = Term.termArrayToList(new Term[] { new Compound("-", new Term[] { a, a }), new Compound("-", new Term[] { a, b }) });

Callers 1

run_testsMethod · 0.95

Calls 1

allSolutionsMethod · 0.95

Tested by

no test coverage detected