Inadequate bytecode testing: unfolded option on empty sequence
Many of the W3C test cases can be defeated by an optimiser that does early evaluation: for example all the starts-with tests in which one of the operands is an empty sequence actually write the operand as "()", which means there are no tests for the case where the operand value is found to be an empty sequence at run-time. We compensate for this with the -unfolded option in the test driver, which modifies the query so that literals are replaced by expressions that return the relevant value at run-time but cannot be eagerly evaluated.
But the -unfolded option has no effect on the literal value "()", because the mechanism relies on trace code injection, and the trace code injector is not called when we generate this expression. This means that the dynamic-empty-sequence case is often untested. This particularly affects tests for byte code generation.
#1 Updated by Michael Kay 24 days ago
I've fixed this on the 11.x branch, but it still leaves the relevant paths untested, because when we use
-unfolded, the effect is that the collation passed to a function like starts-with is itself "unfolded", which means that the collation is not statically known, and we do not generate bytecode for the rare case of a function call whose collation parameter is evaluated dynamically.
Please register to edit this issue