public void testStaticQueryInvalidSourceText2() {
		String goal = "p(]";
		try {
			Query.hasSolution(goal); // should throw exception
			fail(goal + " (bad syntax) succeeded"); // shouldn't get to here
		} catch (org.jpl7.PrologException e) { // expected exception
			if (e.term().hasFunctor("error", 2) && e.term().arg(1).hasFunctor("syntax_error", 1) && e.term().arg(1).arg(1).hasFunctor("cannot_start_term", 0)) {
				// OK: an appropriate exception was thrown
			} else {
				fail(goal + " (bad syntax) threw wrong PrologException: " + e);
			}
		} catch (Exception e) {
			fail(goal + " (bad syntax) threw wrong exception class: " + e);
		}
	}