This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The test <test>fn:exists(fn:available-environment-variable#1)</test> was probably meant to be <test>fn:exists(environment-variable#1)</test>
Also environment-variable-002 is wrong. fn:function-lookup(fn:environment-variable, 1) should be fn:function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'environment-variable'), 1)
Also environment-variable-003 and 004 were probably meant to refer to fn:environment-variable and not available-environment-variables.
Darn, I'm checking how I tested them with BaseX. Well, testing wouldn't tell me I had a wrong function name (the joys of paste) and maybe BaseX is more tolerant.. We should have a separate test that makes sure functions that require QNames don't also accept strings, e.g. function-lookup(function-lookup#0) should presumably be an error. Or we should allow string (which I'd prefer I think) although not function items :) Well, I've committed the changes, thanks for the report! If the test work now please close the bug.
In test environment-variable-006 let $all := fn:available-environment-variables() return empty($all) or ($all = "QTTEST2" and (fn:environment-variable("QTTEST2") eq "other") and (not("other" eq "42"))) I think you may have forgotten a call to environment-variable, in particular near, "other" eq "42" ! In fn-available-environment-variables-002, there's a bracket in the wrong place. not(fn:empty(fn:function-lookup( fn:QName('http://www.w3.org/2005/xpath-functions', 'available-environment-variables', 0)))) should be not(fn:empty(fn:function-lookup( fn:QName('http://www.w3.org/2005/xpath-functions', 'available-environment-variables'), 0)))
I think you may have forgotten a call to environment-variable, in particular > near, > > "other" eq "42" No, that's deliberate, although maybe I should have commented it, and it's almost certainly not really necessary, I doubt we'll have malicious implementations around. It weeds out implementations that say sring1 eq "string2" is always constant. Maybe needsless paranoia on my part. > In fn-available-environment-variables-002, there's a bracket in the wrong place. fixed, thanks!
(In reply to comment #5) > I think you may have forgotten a call to environment-variable, in particular > > near, > > > > "other" eq "42" > > No, that's deliberate, although maybe I should have commented it, and it's > almost certainly not really necessary, I doubt we'll have malicious > implementations around. > > It weeds out implementations that say sring1 eq "string2" is always constant. > Maybe needsless paranoia on my part. Then perhaps the expected result is wrong? Either a) $all is empty - query will return true b) $all contains QTTEST2, QTTEST2 maps to "other" and "other" isn't the same as "42" - query will return true. But the expected result is false.
fixed - maybe my career as a test-writer will be short-lived! :-) (although I hope not) true was indeed intended. Thanks!
Confirmed fixed.