From d93c213be50b80ded6c7ef13098c153bffe77322 Mon Sep 17 00:00:00 2001 From: olabusayoT <50379531+olabusayoT@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:00:45 -0400 Subject: [PATCH] Verify no Abort when documentPart has no type - add test to verify no abort when suite has invalid tdml DAFFODIL-561 --- .../daffodil/tdml/UnitTestTDMLRunner.scala | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala b/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala index 987f9ca482..e4299c1a2f 100644 --- a/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala +++ b/daffodil-tdml-lib/src/test/scala/org/apache/daffodil/tdml/UnitTestTDMLRunner.scala @@ -835,4 +835,26 @@ class UnitTestTDMLRunner { assertEquals(doc2bits, doc1bits) } + @Test def testDocumentPartNoType(): Unit = { + val xml = + + + test/tdml/test.txt + + + + 123 + + + + + val runner = new Runner(xml) + val e = intercept[TDMLException] { + runner.runOneTest("test1") + } + assertTrue(e.getMessage().contains("'type' must appear on element 'documentPart'")) + } + }