Skip to content

Confusion about fn-function-lookup-761 in relation to fn-function-lookup-759 #58

@nkutsche

Description

@nkutsche

Hi, I'm a bit confused about the combination of the test cases fn-function-lookup-759 and fn-function-lookup-761.

The fn-function-lookup-759 says that in any case you should be able to lookup for the function load-xquery-module:

  <test-case name="fn-function-lookup-759" 
             covers="fn-load-xquery-module">
    <description>Attempts to look up function fn:load-xquery-module#1.</description>
    <created by="Tim Mills" on="2016-08-19"/>
    <dependency type="spec" value="XP31+ XQ31+"/>
    <test>exists(function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'load-xquery-module'), 1))</test>
    <result>
      <assert-true/>
    </result>
  </test-case>

Reminder:
The function signature of load-xquery-module#1 is fn:load-xquery-module($module-uri as xs:string) as map(*).

The test case fn-function-lookup-761 says now if you do not support the feature fn-load-xquery-module and make the same lookup as in fn-function-lookup-759 but now call the function with a wrong typed argument, this function must throw an error code FOQM0006:

  <test-case name="fn-function-lookup-761" 
             covers="fn-load-xquery-module"
             covers-30="dynamic-function-call">
    <description>Attempts to invoke function fn:load-xquery-module#1.</description>
    <created by="Tim Mills" on="2016-08-19"/>
    <dependency type="spec" value="XP31+ XQ31+"/>
    <dependency type="feature" value="fn-load-xquery-module" satisfied="false"/>  
    <test>function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'load-xquery-module'), 1)( 0 )</test>
    <result>
      <error code="FOQM0006" />
    </result>
  </test-case>

On my point of view, the error code XPTY0004 for the failed type conversion should be also acceptable, shouldn't it? Otherwise the function returned by function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'load-xquery-module'), 1) must have a signiture which is more lax as the specification requires.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions