[Bug 29727] [xslt30ts] aspiring-001

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29727

--- Comment #2 from Michael Kay <mike@saxonica.com> ---
Looking at the fromHex function again

<xsl:function name="f:fromHex" as="xs:integer">
        <xsl:param name="in" />
        <xsl:variable name="val" select="function($v) { 
            if($v ge 65) then $v - 55 else $v - 48 }" />
        <xsl:sequence select="sum(reverse(string-to-codepoints($in)) ! ($val(.)
* math:pow(16, position() - 1))) cast as xs:integer" />
    </xsl:function>

with $in = "41"

string-to-codepoints($in) = (52, 49)
reverse(string-to-codepoints($in)) = (49, 52)
sum(...) = $val(49) * 16^0 + $val(52) * 16^1
$val(52) = 4
$val(49) = 1
so sum(...) = 1 + 4*16
which is indeed correct.

So it looks like I misdiagnosed the problem.

The trouble generally with more complex tests is that debugging real or
imagined test failures can be an awful lot of work. (For example, the test
framework for system-property() is so complex that if one test gives the wrong
result, isolating the reason can be a nightmare.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Saturday, 16 July 2016 13:36:16 UTC