MCPcopy Create free account
hub / github.com/BaseXdb/basex / assertQuery

Method assertQuery

basex-tests/src/main/java/org/basex/tests/w3c/QT3TS.java:679–689  ·  view source on GitHub ↗

Tests assertion. @param result query result @param expected expected result @return optional expected test suite result

(final QT3Result result, final XdmValue expected)

Source from the content-addressed store, hash-verified

677 * @return optional expected test suite result
678 */
679 private String assertQuery(final QT3Result result, final XdmValue expected) {
680 final String exp = expected.getString();
681 try {
682 final String query = "declare variable $result external; " + exp;
683 return environment(new XQuery(query, ctx), result.env).context(result.value).variable(
684 "$result", result.value).value().getBoolean() ? null : exp;
685 } catch(final XQueryException ex) {
686 // should not occur
687 return ex.getException().getMessage();
688 }
689 }
690
691 /**
692 * Tests count.

Callers 1

testMethod · 0.95

Calls 8

environmentMethod · 0.95
getExceptionMethod · 0.80
getStringMethod · 0.45
getBooleanMethod · 0.45
valueMethod · 0.45
variableMethod · 0.45
contextMethod · 0.45
getMessageMethod · 0.45

Tested by

no test coverage detected