You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "stevedlawrence (via GitHub)" <gi...@apache.org> on 2023/02/01 15:14:42 UTC

[GitHub] [daffodil] stevedlawrence commented on a diff in pull request #944: Only update debug setting on change

stevedlawrence commented on code in PR #944:
URL: https://github.com/apache/daffodil/pull/944#discussion_r1093329471


##########
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:
   It might be beneficial to use a schema that results in multiple infosets. This one will only ever parse one infoset and then the next parse will always fail.
   
   A good schema for this might be `daffodil-cli/src/test/resources/test/cli/fixedLength.dfdl.xsd`. This will stream multiple infosets with each infoset parses just a single byte.
   
   It might also be useful to expect some trace output (e.g. bitPos) to make sure the trace is reporting correct information for each of the multiple parses it will do.



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org