stevedlawrence commented on a change in pull request #334: Add a special
unparser for empty choice branches
URL: https://github.com/apache/incubator-daffodil/pull/334#discussion_r395808593
##########
File path:
daffodil-test/src/test/resources/org/apache/daffodil/section15/choice_groups/choice-unparse2.tdml
##########
@@ -216,4 +216,35 @@
</tdml:infoset>
</tdml:unparserTestCase>
+ <tdml:defineSchema name="c3" elementFormDefault="unqualified">
+
+ <xs:include
schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="delimited"/>
+
+ <xs:element name="choice" dfdl:terminator=";">
+ <xs:complexType>
+ <xs:choice>
+ <xs:sequence>
+ <xs:annotation>
+ <xs:appinfo source="http://www.ogf.org/dfdl/">
+ <dfdl:assert>{ fn:true() eq fn:true() }</dfdl:assert>
+ </xs:appinfo>
+ </xs:annotation>
+ </xs:sequence>
+ <xs:element name="impossible" type="xs:int" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ </tdml:defineSchema>
+
+ <tdml:unparserTestCase name="choice_default_branch_is_empty" model="c3"
root="choice">
+ <tdml:document>;</tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:choice />
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
Review comment:
That's a good question. I'm not sure what our convention is, or if we have
one. The other unparserTestCases in this file have the document first followed
by the infoset, even though that's sort of backwards than one might suspect. I
am able to find some tdml files that have the infoset first for
unparserTestCases, but I think most of them follow this pattern.
I think my inclination is to keep consistent with the rest of the file,
since it doesn't seem we really have an enfoced convention, but I don't feel
strongly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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