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 29788 - Incorrect result for millisecs-018
Summary: Incorrect result for millisecs-018
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: 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: 2016-08-23 17:25 UTC by Josh Spiegel
Modified: 2016-10-18 16:56 UTC (History)
2 users (show)

See Also:


Attachments

Description Josh Spiegel 2016-08-23 17:25:48 UTC
<test-case name="millisecs-018" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
      <description>Fractional seconds: width modifier trumps picture  </description>
      <created by="Michael Kay" on="2016-07-21"/>
      <test><![CDATA[format-time(xs:time('12:01:01.123'), "[f111,2-2]")]]></test>
      <result>
         <assert-eq>"12"</assert-eq>
      </result>
</test-case>

The description reads "width modifier trumps picture" but this is not how the spec reads.  It says (9.8.4.5)  "If there is a width modifier, then the first presentation modifier is adjusted ..." and the following logic does not take digits away.  I would expect the result of this test to be 123.
Comment 1 Michael Kay 2016-09-13 13:31:23 UTC
You're right. I've fixed this, and added a couple more tests.
Comment 2 Tim Mills 2016-09-14 15:35:59 UTC
Aren't these two affected in an identical way?

 
   <test-case name="millisecs-025">
      <description>Fractional seconds: both width modifier and picture  </description>
      <created by="Michael Kay" on="2016-09-13"/>
      <test>format-time(xs:time('12:01:01.1'), "[f1###,3-3]")</test>
      <result>
         <assert-eq>"100"</assert-eq>
      </result>
   </test-case>
   
   <test-case name="millisecs-026">
      <description>Fractional seconds: both width modifier and picture  </description>
      <created by="Michael Kay" on="2016-09-13"/>
      <test>format-time(xs:time('12:01:01.5'), "[f1###,2-3]")</test>
      <result>
         <assert-eq>"50"</assert-eq>
      </result>
   </test-case>