stevedlawrence commented on a change in pull request #179: Return xs:decimal
when dividing xs:long
URL: https://github.com/apache/incubator-daffodil/pull/179#discussion_r254756708
##########
File path:
daffodil-test/src/test/resources/org/apache/daffodil/section23/dfdl_expressions/expressions.tdml
##########
@@ -7184,6 +7185,11 @@
<tdml:infoset><tdml:dfdlInfoset><div21>7.290005321703885E-5</div21></tdml:dfdlInfoset></tdml:infoset>
</tdml:parserTestCase>
+ <tdml:parserTestCase name="div22" root="div22" model="XPathDiv"
description="Section 23 - DFDL Expressions - div"
+ config="cfg_errorOnResultCoercion">
+ <tdml:document></tdml:document>
+
<tdml:infoset><tdml:dfdlInfoset><div22>0.028125</div22></tdml:dfdlInfoset></tdml:infoset>
Review comment:
I'm not sure if this test fully tests that long div long returns a decimal.
If long div long return a double, we will allow automatic upcasting to the
expected xs:decimal type, so this doesn't really show that we're doing the
right thing, I think. This test will probably work without the above change.
Maybe the best way to handle this is to add a unit test somewhere (maybe
TestDFDLExpressionEvaluation.scala) that evaluates an expression and checks the
return type is the correct thing.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services