xspec / xspec

XSpec is a unit test and behaviour-driven development (BDD) framework for XSLT, XQuery, and Schematron.
https://github.com/xspec/xspec/wiki
MIT License
113 stars 31 forks source link

xsl:attribute Code Coverage Non-Conformance #1941

Closed birdya22 closed 3 months ago

birdya22 commented 4 months ago

Current Non-Conformance

The xslt-code-coverage-behavior-by-element.md file says the following for xsl:attribute: "Element Specific - mark as 'ignored' if parent is xsl:attribute-set (xsl:attribute-set will be ignored). For other cases Use Trace Data i.e. mark as 'hit' or 'missed' based on trace data".

Change in xslt-code-coverage-behavior-by-element.md

The xslt-code-coverage-behavior-by-element.md file needs to be updated to says that all descendants of xsl:attribute-set/xsl:attribute need to be marked as 'ignored'.

Changes in coverage-report.xsl

The coverage-report.xsl in 3.0.3 is ok when the parent is NOT xsl:attribute-set.

When the parent is xsl:attribute-set the coverage-report.xsl in 3.0.3 marks them as 'missed' because there is no hit element in the XSpec trace file and there is no rule in coverage-report.xsl to process them.

The simplest rule to add to coverage-report.xsl is to mark all elements as 'ignored' if they have an xsl:attribute-set ancestor (this will cover xsl:attribute as well as any xsl:attribute descendents).

Changes in test/end-to-end/cases-coverage/expected

In the coverage report xsl-attribute-01-coverage.html the 3 xsl:attribute elements which are children of xsl:attribute-set, and their sequence constructors, will be marked as 'ignored' rather than 'missed'. There will be no change to the other xsl:attribute elements.

In the coverage report xsl-attribute-set-01-coverage.html, the 5 xsl:attribute elements which are children of xsl:attribute-set, and their sequence constructors, will be marked as 'ignored' rather than 'missed'. There will be no change to the other xsl:attribute elements.

There will be no change to the xsl:attribute element in the xsl-element-01-coverage.html coverage report.