Bug 19881 - add a <dependency> node to the tests that use HOF feature
add a <dependency> node to the tests that use HOF feature
Status: RESOLVED FIXED
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite
Working drafts
PC Linux
: P2 normal
: ---
Assigned To: O'Neil Delpratt
Mailing list for public feedback on specs from XSL and XML Query WGs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-06 15:05 UTC by Sorin Nasoi
Modified: 2013-01-02 14:23 UTC (History)
2 users (show)

See Also:


Attachments
These tests do not have a HOF dependency defined on neither test case nor test set level (4.00 KB, application/xml)
2012-11-07 21:59 UTC, Sorin Nasoi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sorin Nasoi 2012-11-06 15:05:19 UTC
The HOF feature is optional, so the tests in FOTS using the HOF feature should have a 
<dependency type="feature" value="higher-order-functions" satisfied="true"/> 
node added.

If I am not missing something, all test cases that satisfy the condition:

matches(fn:data($test-case/fots:test),"(function\-lookup)|(function\-name)|(function\-arity)|(map)|(filter)|(fold\-left)|(fold\-right)|(map\-pairs)|(#[1-9])"))

should be marked with a HOF dependency.
Comment 1 Michael Kay 2012-11-06 15:37:31 UTC
I have marked a great many tests with the dependency higherOrderFunctions; see for example

http://dev.w3.org/cvsweb/2011/QT3-test-suite/fn/function-lookup.xml?rev=1.20;content-type=text%2Fplain

where it is defined at test-set level.

If you find specific tests that are missing this dependency - and there are bound to be some - please let us know.
Comment 2 Sorin Nasoi 2012-11-07 21:59:57 UTC
Created attachment 1246 [details]
These tests do not have a HOF dependency defined on neither test case nor test set level

If I am not missing something, all the tests with a $test node that returns true for:

matches($test,"(function\-lookup)|(function\-name)|(function\-arity)|(map)|(filter)|(fold\-left)|(fold\-right)|(map\-pairs)|((a-z)*#[0-9])"))

should be marked with a HOF dependency at the test case level.

The mentioned tests are checked for a HOF dependency at both test case and test set level first.
Comment 3 O'Neil Delpratt 2012-11-08 10:00:59 UTC
Thanks Sorin for the comprehensive list. I have made the changes and committed them to cvs. 

No change were made to the test-cases: 
require-higher-order-function-4-ns
require-higher-order-function-9-ns
prohibit-higher-order-function-4-ns

According to the description of these the desired affect of switching off the HOF features in the implementation is that we expect an error. 

Just to note that some implementations, like ours, may not be able to switch of features externally! I think Ghislain should look at these test cases again.
Comment 4 Sorin Nasoi 2012-11-08 18:00:15 UTC
Are you sure you pushed the updates to CVS for all reported cases?

The following have not yet been updated:
<test-set name="fn-data">
 <test-case name="K2-DataFunc-5"/>
</test-set>
<test-set name="fn-map">
 <test-case name="map-006"/>
</test-set>

Also please wait a bit before marking the bug as fixed because I will post another list of test-cases that might need HOF dependency added.

The REGEX I used to identify the first list of tests did not catch all concurrences.
Comment 5 Sorin Nasoi 2012-11-08 18:30:36 UTC
(In reply to comment #4)
> Are you sure you pushed the updates to CVS for all reported cases?
> 
> The following have not yet been updated:
> <test-set name="fn-data">
>  <test-case name="K2-DataFunc-5"/>
> </test-set>
> <test-set name="fn-map">
>  <test-case name="map-006"/>
> </test-set>
> 
> Also please wait a bit before marking the bug as fixed because I will post
> another list of test-cases that might need HOF dependency added.
> 
> The REGEX I used to identify the first list of tests did not catch all
> concurrences.

OK: here are all the cases that should be looked into:

<test set name="fn-map">add HOF dependency for the whole test set</test set>
<test set name="prod-NamedFunctionRef">add HOF dependency for the whole test set</test set>
<test-set name="fn-data">
 <test-case name="K2-DataFunc-5"/>
</test-set>
<test-set name="fn-map">
 <test-case name="map-006"/>
</test-set>
Comment 6 Ghislain Fourny 2012-12-18 14:01:30 UTC
Hi O'Neil,

You are right - the test cases *-ns correspond to the assumption that a given feature (here, HOF) is not supported, and are hence marked with <dependency type="feature" value="higherOrderFunctions" satisfied="false"/>.

If an implementation does not support HOF, it must run these tests to check that it behaves appropriately for require-feature/prohibit-feature.

(In reply to comment #3)
> Thanks Sorin for the comprehensive list. I have made the changes and
> committed them to cvs. 
> 
> No change were made to the test-cases: 
> require-higher-order-function-4-ns
> require-higher-order-function-9-ns
> prohibit-higher-order-function-4-ns
> 
> According to the description of these the desired affect of switching off
> the HOF features in the implementation is that we expect an error. 
> 
> Just to note that some implementations, like ours, may not be able to switch
> of features externally! I think Ghislain should look at these test cases
> again.
Comment 7 Ghislain Fourny 2012-12-18 14:02:59 UTC
I added HOF dependency tags to the following test sets:

fn-map
prod-namedFunctionRef

as well as to the following test cases:

fn-unparsed-text-003
fn-unparsed-text-004
fn-unparsed-text-available-003
fn-unparsed-text-available-004
fn-unparsed-text-lines-003
fn-unparsed-text-lines-004
K2-DataFunc-5
Comment 8 Ghislain Fourny 2012-12-18 14:07:49 UTC
> Just to note that some implementations, like ours, may not be able to switch
> of features externally! I think Ghislain should look at these test cases
> again.

My understanding is that it is not required to switch off HOF. If an implementation supports HOF and does not provide a means of switching it off externally, I think the semantics of the tags set to false is that it should just skip (ignore) these tests.
Comment 9 Ghislain Fourny 2012-12-19 14:00:31 UTC
I have also added a dependency tag on test case contextDecl-055.