This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21868 - "serialization-matches" test cases not accounting for the latest XQuery spec.
Summary: "serialization-matches" test cases not accounting for the latest XQuery spec.
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-29 17:55 UTC by Sorin Nasoi
Modified: 2013-06-04 16:21 UTC (History)
1 user (show)

See Also:


Attachments

Description Sorin Nasoi 2013-04-29 17:55:01 UTC
Test-cases 
"Serialization-026,Serialization-027,Serialization-028,Serialization-029,Serialization-030"
from "prod-OptionDecl.serialization" test-set assume an XQuery implementation MUST support serialization parameters specified in the query prolog.

According to the 
http://www.w3.org/TR/xquery-30/#id-serialization
spec:

"If an XQuery implementation provides a serialization interface, it may support (and may expose to users) any of the serialization parameters listed (with default values) in C.1 Static Context Components. If an implementation does not support one of these parameters, it must ignore it without raising an error."
[...]
"Processors may also allow external mechanisms for specifying serialization parameters, which may or may not override serialization parameters specified in the query prolog."

The test cases should be updated to reflect the latest version of the spec.
Comment 1 O'Neil Delpratt 2013-05-02 14:35:46 UTC
Probably the approach to take is to have two variants of the test case:

*one where where we add the dependency expecting the support of serialization parameters, i.e. satisfied=true.

* The other where were the dependency on the serialization parameters is not available, i.e. satisfied=false

If you agree, I will make the change.
Comment 2 Sorin Nasoi 2013-05-02 19:36:59 UTC
(In reply to comment #1)
> Probably the approach to take is to have two variants of the test case:
> 
> *one where where we add the dependency expecting the support of
> serialization parameters, i.e. satisfied=true.
> 
> * The other where were the dependency on the serialization parameters is not
> available, i.e. satisfied=false
> 
> If you agree, I will make the change.
Agree but first I think one has to create a new dependency in FOTS for the serialization parameters specified in prolog, right?
Comment 3 Sorin Nasoi 2013-05-09 15:51:32 UTC
Please note that same reported problem applies to 23 of the new test-cases added in the test-set "misc-Serialization" that were created by Henry Zongaro:

Here are the 23 test-case names:

"Serialization-html-1", "Serialization-html-2", "Serialization-html-3", "Serialization-html-4", "Serialization-html-18", "Serialization-html-19a", "Serialization-html-19b", "Serialization-html-19c", "Serialization-html-22", "Serialization-html-25", "Serialization-html-26", "Serialization-html-27, "Serialization-html-28", "Serialization-html-29", "Serialization-html-30", "Serialization-html-33", "Serialization-html-34", "Serialization-html-35", "Serialization-html-36", "Serialization-html-37", "Serialization-html-38", "Serialization-html-39", "Serialization-html-40"
Comment 4 O'Neil Delpratt 2013-05-30 10:52:17 UTC
Bug now fixed according to comment #1 and committed to cvs. 

Just to confirm I have added a new feature dependency (see below) for all the serialization tests specified:
<dependency type="feature" value="serialization" satisfied="true"/>

This means that vendors will need to add this new dependency feature in their respective test drivers.

I have added test variants for Serialization-026,Serialization-027, ideally for implementers who cannot support serialization; here the serialization feature is set satisfied="false". I have Given them the name Serialization-026a,Serialization-027a, respectively. Please check that the assertions are ok?
Comment 5 Sorin Nasoi 2013-05-30 21:58:26 UTC
The following test-cases from "prod-OptionDecl.serialization" test-set need to be added the <dependency type="feature" value="serialization" satisfied="true"/>:

- "Serialization-004", "Serialization-005", "Serialization-031", "Serialization-032"
Comment 6 O'Neil Delpratt 2013-06-03 08:37:45 UTC
(In reply to comment #5) 
> - "Serialization-004", "Serialization-005", "Serialization-031",
> "Serialization-032"

Dependency added to the tests as suggested
Comment 7 Andrew Eisenberg 2013-06-03 19:58:36 UTC
Test Serialization-026a assumes that the serialization feature is not supported.

         declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
         declare option output:method "xml";
         declare option output:standalone "yes";
		 (<a/>,<b/>)


It expects "<a/> <b/>". I believe that "<a/><b/>" is the value that should be expected.
Comment 8 O'Neil Delpratt 2013-06-04 09:40:49 UTC
(In reply to comment #7)
> It expects "<a/> <b/>". I believe that "<a/><b/>" is the value that should
> be expected.

Thanks Andrew. Fixed applied.
Comment 9 Andrew Eisenberg 2013-06-04 14:23:43 UTC
I'm looking more closely at Serialization-026a:

      <result>
           <assert-string-value><![CDATA[<a/><b/>]]></assert-string-value>
      </result>

assert-string-value applies this expression to the result:

      string-join(for $r in $result return string($r), " ")

This generates a result of " " for the query (<a/>,<b/>).
Comment 10 O'Neil Delpratt 2013-06-04 14:33:18 UTC
I am not sure how best to resolve this one. We cannot use <assert/> or <assert-xml/> because the output is not a valid XML document. Any suggestions?
Comment 11 O'Neil Delpratt 2013-06-04 16:21:24 UTC
AS discussed in the WG telecon. My suggestion was agreed with to add a enclosing element in the query. This means that we can now use assert-xml for the expected output. 

The new test-case is as follows:

   <test-case name="Serialization-026a">
     ...
      <dependency type="feature" value="serialization" satisfied="false"/>
      <test><![CDATA[
         declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
         declare option output:method "xml";
         declare option output:standalone "yes";
		 <out>{(<a/>,<b/>)}</out>
      ]]></test>
      <result>
           <assert-xml><![CDATA[<out><a/><b/></out>]]></assert-xml>
      </result>
   </test-case>