You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Dave Thompson (Jira)" <ji...@apache.org> on 2021/01/29 21:12:00 UTC
[jira] [Commented] (DAFFODIL-488) Odd Behavior with 'YYYY' year
formatting
[ https://issues.apache.org/jira/browse/DAFFODIL-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275357#comment-17275357 ]
Dave Thompson commented on DAFFODIL-488:
----------------------------------------
Test "datePattern01b" is commented out. After uncommenting and adding ":Unit =" to the "@Test def" statement the test got he following error. Appears there is still and issue.
ERROR:
[error] Test org.apache.daffodil.section05.simple_types.TestSimpleTypes.test_datePattern01b failed: org.apache.daffodil.tdml.TDMLExceptionImpl: (Implementation: daffodil) XMLDifferenceException:
[error] Comparison failed.
[error] Expected (attributes stripped)
[error] <date01b>2013-01-25</date01b>
[error] Actual (attributes ignored for diff)
[error] <ex:date01b xmlns:ex="http://example.com">0200-12-28</ex:date01b>
[error] Differences were (path, expected, actual):
[error] - (date01b.charAt(1),2013-01-25,0200-12-28)
[error] , took 0.11 sec
[error] at org.apache.daffodil.tdml.TDMLException$.apply(TDMLException.scala:32)
[error] at org.apache.daffodil.tdml.VerifyTestCase$.verifyParserTestData(TDMLRunner.scala:1494)
[error] at org.apache.daffodil.tdml.ParserTestCase.verifyParseResults(TDMLRunner.scala:985)
[error] at org.apache.daffodil.tdml.ParserTestCase.runParseExpectSuccess(TDMLRunner.scala:1093)
[error] at org.apache.daffodil.tdml.ParserTestCase.$anonfun$runProcessor$2(TDMLRunner.scala:844)
[error] at org.apache.daffodil.tdml.ParserTestCase.$anonfun$runProcessor$2$adapted(TDMLRunner.scala:841)
[error] at scala.util.Either$RightProjection.foreach(Either.scala:652)
[error] at org.apache.daffodil.tdml.ParserTestCase.runProcessor(TDMLRunner.scala:841)
[error] at org.apache.daffodil.tdml.TestCase.run(TDMLRunner.scala:796)
[error] at org.apache.daffodil.tdml.DFDLTestSuite.runOneTest(TDMLRunner.scala:386)
[error] at org.apache.daffodil.tdml.Runner.runOneTest(RunnerFactory.scala:144)
[error] at org.apache.daffodil.tdml.Runner.runOneTest(RunnerFactory.scala:150)
[error] at org.apache.daffodil.section05.simple_types.TestSimpleTypes.test_datePattern01b(TestSimpleTypes.scala:266)
[error] ...
[error] Caused by: org.apache.daffodil.xml.XMLUtils$XMLDifferenceException:
[error] Comparison failed.
[error] Expected (attributes stripped)
[error] <date01b>2013-01-25</date01b>
[error] Actual (attributes ignored for diff)
[error] <ex:date01b xmlns:ex="http://example.com">0200-12-28</ex:date01b>
[error] Differences were (path, expected, actual):
[error] - (date01b.charAt(1),2013-01-25,0200-12-28)
[error] at org.apache.daffodil.xml.XMLUtils$.compareAndReport(XMLUtils.scala:835)
[error] at org.apache.daffodil.tdml.VerifyTestCase$.verifyParserTestData(TDMLRunner.scala:1491)
[error] ... 66 more
> Odd Behavior with 'YYYY' year formatting
> ----------------------------------------
>
> Key: DAFFODIL-488
> URL: https://issues.apache.org/jira/browse/DAFFODIL-488
> Project: Daffodil
> Issue Type: Bug
> Components: Back End, ICU
> Reporter: Jessie Chab
> Priority: Minor
> Labels: reverify
>
> I've noticed that if you use 'YYYY' instead of 'yyyy', the year is parsed as one less than the specified year, and the other values are not parsed correctly.
> Response from Steve:
> Regarding the odd output of YYYY: I'm not exactly sure why this doesn't work, but I'm not surprised. From what I can tell, YYYY is the year part of the ISO Week Date. This uses a modified gregorian calendar, so I'm not surprised you're getting odd results. However, I've tried creating a pattern that uses the ISO Week Date formatting symbols ("YYYY-'W'ww-e") and try to parse the examples from the wiki page. I get dates similar to the examples, but they are usually off by a few days. So I'm not sure what's wrong. I don't think this is a blocker for Spin 7, so please create a new bug for the YYYY issue, and we'll fix it as we find time.
> See test datePattern01b in daffodil-test/src/test/resources/daffodil/section05/simple_types/SimpleTypes.tdml
--
This message was sent by Atlassian Jira
(v8.3.4#803005)