mike-mcgann commented on code in PR #944:
URL: https://github.com/apache/daffodil/pull/944#discussion_r1093407919


##########
daffodil-cli/src/test/scala/org/apache/daffodil/cliTest/TestCLIParsing.scala:
##########
@@ -590,6 +590,19 @@ class TestCLIparsing {
     } (ExitCode.LeftOverData)
   }
 
+  @Test def test_XXX_CLI_Parsing_Stream_03(): Unit = {
+    val schema = 
path("daffodil-cli/src/test/resources/org/apache/daffodil/CLI/cli_schema_02.dfdl.xsd")
+
+    runCLI(args"--trace parse --stream -s $schema") { cli =>
+      cli.send("123ab", inputDone = true)
+      cli.expect("<a>1</a>")
+      cli.expect("<a>2</a>")
+      cli.expect("<a>3</a>")
+      cli.expectErr("Left over data after consuming 0 bits while streaming.")
+      cli.expectErr("Stopped after consuming 24 bit(s) with at least 16 bit(s) 
remaining.")
+    } (ExitCode.LeftOverData)

Review Comment:
   The output generates three separate XML documents which I thought was three 
separate infosets. I removed the `ab` from the input data and based the test on 
CLI_Parsing_Stream_01 instead. With this command:
   
   ```
   echo -n "123" | daffodil parse --stream -s 
daffodil-cli/src/test/resources/org/apache/daffodil/CLI/cli_schema_02.dfdl.xsd
   ```
   
   I get the following output:
   
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <ex:elem xmlns:ex="http://example.com";>
     <a>1</a>
   </ex:elem>
   <?xml version="1.0" encoding="UTF-8"?>
   <ex:elem xmlns:ex="http://example.com";>
     <a>2</a>
   </ex:elem>
   <?xml version="1.0" encoding="UTF-8"?>
   <ex:elem xmlns:ex="http://example.com";>
     <a>3</a>
   </ex:elem>
   ```
   
   Is this test sufficient or should I still change to using 
`fixedLength.dfdl.xsd`? 
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to