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 3009 - testsuite should allow year zero
Summary: testsuite should allow year zero
Status: RESOLVED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-16 04:14 UTC by Per Bothner
Modified: 2006-08-30 18:52 UTC (History)
0 users

See Also:


Attachments

Description Per Bothner 2006-03-16 04:14:11 UTC
Some tests (such as op-add-yearMonthDuration-to-dateTime-8) assume that the year before year 1 is year -1.  The follows XML Schema 1.0, but they have at "note" (in section 3.2.7):
  It is the intention of the XML Schema Working Group to allow '0000' as a
  lexical representation in the dateTime, date, gYear, and gYearMonth 
  datatypes in a subsequent version of this Recommendation. '0000' will be
  the lexical representation of 1 BCE (which is a leap year), '-0001' will
  become the lexical representation of 2 BCE (not 1 BCE as in this (1.0)
  version), '-0002' of 3 BCE, etc.
And indeed XML Schema 1.1 Last Call has made that change.
It seems inappropriate for an XQuery conformance suite to prohibit conformance with XML Schema 1.1 ...
Ideally, the testsuite would use alternative results to allow either model.
Comment 1 Andrew Eisenberg 2006-03-16 18:28:57 UTC
Per makes a good point. I suggest supporting both the current and future behavior of xs:dateTime.
Comment 2 Carmelo Montanez 2006-03-16 20:01:49 UTC
So, if I am following this correctly, the alternate outcome will be:
"-0020-06-01T01:01:01Z" (for op-add-yearMonthDuration-to-dateTime-8
in particular).

Carmelo
Comment 3 Per Bothner 2006-03-16 20:24:03 UTC
(In reply to comment #2)
> So, if I am following this correctly, the alternate outcome will be:
> "-0020-06-01T01:01:01Z" (for op-add-yearMonthDuration-to-dateTime-8
> in particular).

I think so.  At least that is what the working version of Qexo returns.
I can't promise there are no bugs in it's handling of negative years, though!

There are other tests with the same issue:
op-subtract-yearMonthDuration-from-dateTime2args-5
op-add-yearMonthDuration-to-date-8
op-subtract-yearMonthDuration-from-date2args-5
Comment 4 Carmelo Montanez 2006-03-17 16:17:42 UTC
Per:

Thanks for the comment. Changed the catalog file to allow for the extra outcome, which considers the zero.  Sumitted extra files.  Please close
the bug if in agreement and able to verify.

Thanks,
Carmelo
Comment 5 Per Bothner 2006-03-19 08:34:42 UTC
(In reply to comment #4)
> Thanks for the comment. Changed the catalog file to allow for the extra
> outcome, which considers the zero.  Sumitted extra files.  Please close
> the bug if in agreement and able to verify.

Not sure what you mean by "able to verify".  I don't really see how I'd do that unless you send me a patch, or the next version of the testsuite comes out.  Is there a publicly-readable CVS (or whatever) respository of the testsuite?
Comment 6 Per Bothner 2006-08-23 23:59:37 UTC
I found 3 more, in the CVS version of the testsuite:

op-add-dayTimeDuration-to-dateTime-8
[Should also allow "0000-12-21T09:09:11Z".]

op-add-dayTimeDuration-to-date-8
[Should also allow "0000-12-20Z".]

op-subtract-dayTimeDuration-from-date-8
[Should also allow "0000-12-20Z".]
Comment 7 Carmelo Montanez 2006-08-30 18:52:29 UTC
Perth:

Changed entry of last set of tests you found by adding extra expected outcome.

Thanks,
Carmelo