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 3345 - Some K-* tests are not static typing savvy
Summary: Some K-* tests are not static typing savvy
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.9.4
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Frans Englich
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-18 20:12 UTC by Marc Van Cappellen
Modified: 2006-07-13 11:39 UTC (History)
0 users

See Also:


Attachments

Description Marc Van Cappellen 2006-06-18 20:12:00 UTC
A number of the new tests in XQTS 0.9.4 are not considering static typing-based implementations. 

As an example, let's have a close look at K-ContextLastFunc-24
  (1, 2, 3, 4, current-time(), 4, 5, 6)[last() - 2] eq 4
The eq operator has 2 arguments.
The first one is statically typed as (xs:integer | xs:time)*
The second argument is statically typed as xs:integer.
According the formal semantic rules this should raise XPTY0004, as xs:integer and xs:time are not valid operands for the eq operator.
For this particular case we see the following solutions
- add XPTY0004 as an accepted error
- remove the current-time() from the first operand
- remove "eq 4", and update the expected result from true to 4.

Here is the complete list of K-* tests:
K-ContextLastFunc-24.xq
K-ContextLastFunc-25.xq
K-ContextLastFunc-26.xq
K-ContextLastFunc-27.xq
K-ContextLastFunc-5.xq
K-ContextPositionFunc-20.xq
K-ContextPositionFunc-21.xq
K-ContextPositionFunc-22.xq
K-ContextPositionFunc-23.xq
K-EncodeURIfunc-6.xq
K-EscapeHTMLURIFunc-6.xq
K-CondExpr-12.xq
K-CondExpr-3.xq
K-CondExpr-6.xq
K-CondExpr-8.xq
K-WhereExpr-7.xq
K-WhereExpr-8.xq
K-WhereExpr-9.xq
K-LogicExpr-14.xq
K-LogicExpr-15.xq
K-LogicExpr-25.xq
K-LogicExpr-26.xq
K-LogicExpr-27.xq
K-LogicExpr-32.xq
K-LogicExpr-33.xq
K-LogicExpr-42.xq
K-LogicExpr-43.xq
K-LogicExpr-44.xq
K-NumericAdd-51.xq
K-NumericAdd-52.xq
K-NumericAdd-53.xq
K-NumericAdd-54.xq
K-NumericAdd-55.xq
K-NumericAdd-56.xq
K-NumericAdd-57.xq
K-NumericAdd-58.xq
K-NumericSubtract-36.xq
K-NumericSubtract-37.xq
K-NumericSubtract-38.xq
K-QuantExprWithout-33.xq
K-QuantExprWithout-7.xq
K-QuantExprWithout-8.xq
K-RangeExpr-31.xq
K-RangeExpr-32.xq
K-FilterExpr-36.xq
K-FilterExpr-51.xq
K-FilterExpr-52.xq
K-FilterExpr-74.xq
K-SeqExprCast-144.xq
K-SeqExprTreat-15.xq
K-IRIToURIfunc-4.xq
K-NormalizeSpaceFunc-9.xq
K-NotFunc-10.xq
K-SeqBooleanFunc-16.xq
K-SeqRemoveFunc-12.xq
K-SeqRemoveFunc-21.xq
K-SeqRemoveFunc-22.xq
K-SeqRemoveFunc-23.xq
K-SeqReverseFunc-20.xq
K-SeqReverseFunc-21.xq
K-SeqReverseFunc-8.xq
K-SeqSubsequenceFunc-11.xq
K-SeqSubsequenceFunc-26.xq
K-SeqSubsequenceFunc-40.xq
K-SeqSubsequenceFunc-41.xq
K-SeqSubsequenceFunc-42.xq
K-SeqSubsequenceFunc-8.xq
K-SeqSubsequenceFunc-9.xq
K-SeqSUMFunc-22.xq

Thanks,
Marc
Comment 1 Frans Englich 2006-07-01 11:07:36 UTC
Isn't another solution to wrap the operand with 'treat as'? Like this:

(1, 2, 3, 4, current-time(), 4, 5, 6)[last() - 2] treat as xs:integer eq 4

I'm considering fixing them like this because it has the minimum impact on the tests.

I think this would make the tests conform to the static typing feature -- but it's probably best to check with you first!
Comment 2 Marc Van Cappellen 2006-07-01 17:41:46 UTC
yes that fine for this particular case.
I haven't gobe through all the listed tests but I assume this will also do it for most, if not all, other tests.
Comment 3 Frans Englich 2006-07-05 19:01:47 UTC
Fixed in CVS. However, I think it is statistically likely that I've missed or somehow broken some tests, so it wouldn't surprise me if we have to do a "second round" on this. Thanks for compiling the list, it was of course very helpful.

How the tests were modified varied between adding XPTY0004, changing the queries(mostly adding treat as), and changing the baseline.


Frans
Comment 4 Tom Brosens 2006-07-13 11:39:14 UTC
For the 'second round' a new bug has been logged. See http://www.w3.org/Bugs/Public/show_bug.cgi?id=3450

This one can be closed.

Thanks,
Tom.