<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17188</bug_id>
          
          <creation_ts>2012-05-25 13:09:01 +0000</creation_ts>
          <short_desc>[QT3TS] environment-variable-001</short_desc>
          <delta_ts>2012-05-31 08:15:36 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Mills">tim</reporter>
          <assigned_to name="Liam R E Quin">liam</assigned_to>
          <cc>liam</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68124</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-05-25 13:09:01 +0000</bug_when>
    <thetext>The test

  &lt;test&gt;fn:exists(fn:available-environment-variable#1)&lt;/test&gt;

was probably meant to be

  &lt;test&gt;fn:exists(environment-variable#1)&lt;/test&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68125</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-05-25 13:11:49 +0000</bug_when>
    <thetext>Also environment-variable-002 is wrong.

fn:function-lookup(fn:environment-variable, 1)

should be

fn:function-lookup(fn:QName(&apos;http://www.w3.org/2005/xpath-functions&apos;, &apos;environment-variable&apos;), 1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68126</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-05-25 13:14:03 +0000</bug_when>
    <thetext>Also environment-variable-003 and 004 were probably meant to refer to fn:environment-variable and not available-environment-variables.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68132</commentid>
    <comment_count>3</comment_count>
    <who name="Liam R E Quin">liam</who>
    <bug_when>2012-05-25 13:56:16 +0000</bug_when>
    <thetext>Darn, I&apos;m checking how I tested them with BaseX. Well, testing wouldn&apos;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&apos;t also accept strings, e.g. function-lookup(function-lookup#0) should presumably be an error. Or we should allow string (which I&apos;d prefer I think) although not function items :)

Well, I&apos;ve committed the changes, thanks for the report!

If the test work now please close the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68136</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-05-25 14:46:01 +0000</bug_when>
    <thetext>In test environment-variable-006

let $all := fn:available-environment-variables()
          return empty($all) or
              ($all = &quot;QTTEST2&quot;
               and (fn:environment-variable(&quot;QTTEST2&quot;) eq &quot;other&quot;)
               and (not(&quot;other&quot; eq &quot;42&quot;)))

I think you may have forgotten a call to environment-variable, in particular near,

 &quot;other&quot; eq &quot;42&quot;

!


In fn-available-environment-variables-002, there&apos;s a bracket in the wrong place.

not(fn:empty(fn:function-lookup(
          fn:QName(&apos;http://www.w3.org/2005/xpath-functions&apos;,
          &apos;available-environment-variables&apos;, 0))))

should be

not(fn:empty(fn:function-lookup(
          fn:QName(&apos;http://www.w3.org/2005/xpath-functions&apos;,
          &apos;available-environment-variables&apos;), 0)))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68139</commentid>
    <comment_count>5</comment_count>
    <who name="Liam R E Quin">liam</who>
    <bug_when>2012-05-25 15:05:54 +0000</bug_when>
    <thetext>I think you may have forgotten a call to environment-variable, in particular
&gt; near,
&gt; 
&gt;  &quot;other&quot; eq &quot;42&quot;

No, that&apos;s deliberate, although maybe I should have commented it, and it&apos;s almost certainly not really necessary, I doubt we&apos;ll have malicious implementations around.

It weeds out implementations that say sring1 eq &quot;string2&quot; is always constant. Maybe needsless paranoia on my part.


&gt; In fn-available-environment-variables-002, there&apos;s a bracket in the wrong place.
fixed, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68140</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-05-25 15:25:04 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; I think you may have forgotten a call to environment-variable, in particular
&gt; &gt; near,
&gt; &gt; 
&gt; &gt;  &quot;other&quot; eq &quot;42&quot;
&gt; 
&gt; No, that&apos;s deliberate, although maybe I should have commented it, and it&apos;s
&gt; almost certainly not really necessary, I doubt we&apos;ll have malicious
&gt; implementations around.
&gt; 
&gt; It weeds out implementations that say sring1 eq &quot;string2&quot; is always constant.
&gt; 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 &quot;other&quot; and &quot;other&quot; isn&apos;t the same as &quot;42&quot; - query will return true.

But the expected result is false.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68284</commentid>
    <comment_count>7</comment_count>
    <who name="Liam R E Quin">liam</who>
    <bug_when>2012-05-30 02:22:37 +0000</bug_when>
    <thetext>fixed - maybe my career as a test-writer will be short-lived! :-)

(although I hope not) true was indeed intended. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68365</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-05-31 08:15:28 +0000</bug_when>
    <thetext>Confirmed fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>