This is an automated email from the ASF dual-hosted git repository.

olabusayo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git


The following commit(s) were added to refs/heads/main by this push:
     new 8da6a15bd Verify Blank OutputNewLine causes SDE
8da6a15bd is described below

commit 8da6a15bd859bae51fa82bd4ba506c2ec8fed8f9
Author: olabusayoT <[email protected]>
AuthorDate: Tue Nov 12 14:27:42 2024 -0500

    Verify Blank OutputNewLine causes SDE
    
    - add test to verify we SDE instead of unclear Unparser error as stated in 
the ticket
    
    DAFFODIL-1589
---
 .../section00/general/testUnparserGeneral.tdml     | 36 ++++++++++++++++++++++
 .../section00/general/TestUnparserGeneral.scala    |  3 ++
 2 files changed, 39 insertions(+)

diff --git 
a/daffodil-test/src/test/resources/org/apache/daffodil/section00/general/testUnparserGeneral.tdml
 
b/daffodil-test/src/test/resources/org/apache/daffodil/section00/general/testUnparserGeneral.tdml
index 2b4691fe4..c5fd2ac32 100644
--- 
a/daffodil-test/src/test/resources/org/apache/daffodil/section00/general/testUnparserGeneral.tdml
+++ 
b/daffodil-test/src/test/resources/org/apache/daffodil/section00/general/testUnparserGeneral.tdml
@@ -952,4 +952,40 @@
     </tdml:infoset>
   </tdml:unparserTestCase>
 
+  <tdml:defineSchema name="emptyOutputNewLine">
+    <xs:include 
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
+
+    <dfdl:format ref="ex:GeneralFormat" encoding="ascii"
+        lengthUnits="bytes"/>
+
+    <xs:element name="e1" dfdl:lengthKind="implicit">
+      <xs:complexType>
+        <xs:sequence dfdl:initiator="[" dfdl:separator="," dfdl:terminator="]">
+          <xs:element name="s1" type="xs:string" dfdl:lengthKind="delimited" 
dfdl:outputNewLine=""/>
+          <xs:element name="s2" type="xs:string" dfdl:lengthKind="delimited" 
dfdl:outputNewLine=""/>
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>
+  </tdml:defineSchema>
+
+  <tdml:unparserTestCase name="emptyOutputNewLine1" model="emptyOutputNewLine"
+      roundTrip="none">
+    <tdml:errors>
+      <tdml:error>dfdl:outputNewLine</tdml:error>
+      <tdml:error>length of string</tdml:error>
+      <tdml:error>1 character</tdml:error>
+      <tdml:error>CRLF</tdml:error>
+      <tdml:error>2 characters</tdml:error>
+    </tdml:errors>
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <ex:e1>
+          <ex:s1>hello</ex:s1>
+          <ex:s2>world</ex:s2>
+        </ex:e1>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:unparserTestCase>
+
+
 </tdml:testSuite>
diff --git 
a/daffodil-test/src/test/scala/org/apache/daffodil/section00/general/TestUnparserGeneral.scala
 
b/daffodil-test/src/test/scala/org/apache/daffodil/section00/general/TestUnparserGeneral.scala
index f0d40c8c1..49c7ec8b9 100644
--- 
a/daffodil-test/src/test/scala/org/apache/daffodil/section00/general/TestUnparserGeneral.scala
+++ 
b/daffodil-test/src/test/scala/org/apache/daffodil/section00/general/TestUnparserGeneral.scala
@@ -124,4 +124,7 @@ class TestUnparserGeneral {
   @Test def test_alignmentPaddingOVC3(): Unit = { 
runner.runOneTest("alignmentPaddingOVC3") }
   @Test def test_alignmentPaddingOVC4(): Unit = { 
runner.runOneTest("alignmentPaddingOVC4") }
 
+  // DFDL-1589
+  @Test def test_emptyOutputNewLine1(): Unit = { 
runner.runOneTest("emptyOutputNewLine1") }
+
 }

Reply via email to