This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Firstly, this test could be moved to the fn-random-number-generator test set. Secondly, the return statement of the test says: return if (not(count(distinct-values($r)) > 0.5*count($r))) then fn:error(fn:random-number-generator, '') else if (not(not(deep-equal($r, fn:sort($r))))) then fn:error(fn:random-number-generator, '') else if (not(count($r[. lt 0.5]) > 0.2*count($r) and count($r[. gt 0.5]) > 0.2*count($r))) then fn:error(fn:random-number-generator, '') else fn:true() But the arguments to fn:error() do not make sense. I'm not quite sure what the intention was. Should the test even be throwing errors if the spec says (last paragraph of 4.9.1. Notes): "The specification does not place strong conformance requirements on the actual randomness of the result..."
I think the idea of testing for conditions that strongly suggest a very high probability of non-randomness is reasonable enough. The problems are in the execution. The fn:error() paths would be better written to simply return false(). And yes, the test should be in test set fn-random-number-generator.
I am assigning this bug to Loren to resolve.
Test cases have been updated.
Confirmed that it has now been fixed