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 5690 - CVS: Static Typing: FunctX tests needs adjustment
Summary: CVS: Static Typing: FunctX tests needs adjustment
Status: RESOLVED WONTFIX
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: Other Linux
: P2 normal
Target Milestone: ---
Assignee: Frans Englich
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-16 07:48 UTC by Frans Englich
Modified: 2008-11-13 16:43 UTC (History)
1 user (show)

See Also:


Attachments

Description Frans Englich 2008-05-16 07:48:29 UTC
Most likely the FunctX contains static typing errors and therefore needs alternative queries for static typing queries.

This is currently being looked into, but feel free to add further comments on this topic here.
Comment 1 Michael Kay 2008-05-16 08:31:34 UTC
I feel strongly that we should not exclude real-life test cases such as the functx tests from our suite simply because they do not meet a self-imposed rule on static typing. The fact is, many implementations of XQuery do dynamic typing, and it's useful to implementors and users to know that these implementations are interoperable. We should mark the tests in the catalog as not passing static typing, but otherwise leave them unchanged.

As for the namespace not being example.com, it seems a frivolous objection. Who benefits from the work needed to make the change?
Comment 2 Frans Englich 2008-05-16 09:38:36 UTC
We added a new static-name attribute on element query some time ago, it looks like this:

<query name="Constr-comppi-compname-8" static-name="Constr-comppi-compname-8-static-cbcl" date="2005-05-20"/>

So, when adapting to static typing, a new query is added instead of that the original query suffer. So with this approach I think it's not destructive to extend the coverage to include static typing implementations. Appears to already be used in a 160 cases.

Regarding, example.com: well, this case happened to be easy to fix:

commit 74d67939ad38af1c81c2ad441bfd03dfe74ac32e
Author: Frans Englich <fenglich@fastmail.fm>
Date:   Fri May 16 10:40:11 2008 +0200

    Use example.com instead.

diff --git a/generateFiles.xsl b/generateFiles.xsl
index 5868893..cdd0be6 100644
--- a/generateFiles.xsl
+++ b/generateFiles.xsl
@@ -41,7 +41,7 @@
 (: Date: <xsl:sequence select="current-date()"/>                                       :)
 (:**************************************************************:)

-declare namespace functx = "http://www.functx.com";</xsl:value-of>
+declare namespace functx = "http://www.example.com/";</xsl:value-of>^M
             <xsl:apply-templates select="local:allDependenciesFor($from)//dat:nsDecl"/>

             <!-- We add a dot, so we eliminate duplicates. -->

Comment 3 Nick Jones 2008-05-16 16:03:31 UTC
For most of the changes I'm seeking to make static-typing specific tests using static=name="...", but for functx-functx-substring-before-match-* I'd like to change the return type for the normal version, unless anyone objects. So currently we have:

declare function functx:substring-before-match
  ( $arg as xs:string? ,
    $regex as xs:string )  as xs:string {

   tokenize($arg,$regex)[1]
 } ;


The current function will return an empty sequence if $arg is empty, so really should be defined as xs:string?
Comment 4 Nick Jones 2008-05-16 16:33:38 UTC
Similarly for functx-functx-max-line-length-* the function:

declare function functx:max-line-length
  ( $arg as xs:string? )  as xs:integer {

   max(
     for $line in functx:lines($arg)
     return string-length($line))
 } ;

May return at empty-sequence if $arg is an empty sequence, so I think should have return type xs:integer? in the normal version rather than a static-typing specific version.
Comment 5 Frans Englich 2008-05-16 18:06:51 UTC
Yeah, I'll fix those.
Comment 6 Frans Englich 2008-06-26 11:32:43 UTC
Requests in comment #3 and #4 should be fixed in CVS.
Comment 7 Frans Englich 2008-11-13 16:43:29 UTC
I'm closing this report, the demand comes from Nick & co, who will provide the patch for this if they see the need.