olabusayoT commented on a change in pull request #258: Adds bitawareness to
left over data dump
URL: https://github.com/apache/incubator-daffodil/pull/258#discussion_r299962629
##########
File path:
daffodil-cli/src/it/scala/org/apache/daffodil/parsing/TestCLIParsing.scala
##########
@@ -835,8 +835,64 @@ class TestCLIparsing {
val cmd = String.format("echo 1,2,3,4,,,| %s parse -s %s -r matrix",
Util.binPath, testSchemaFile)
shell.sendLine(cmd)
shell.expect(contains("Left over data. Consumed 56 bit(s) with at
least"))
- shell.expect(contains("Data (UTF-8) starting at byte 8 is: ("))
- shell.expect(contains("Data (Hex) starting at byte 8 is: ("))
+ shell.expect(contains("Left over data (Hex) starting at byte 8 is: ("))
+ shell.expect(contains("Left over data (UTF-8) starting at byte 8 is: ("))
+ shell.sendLine("exit")
+ shell.expect(eof)
+ } finally {
+ shell.close()
+ }
+ }
+
+ @Test def test_CLI_Parsing_BitParse_LSBPartialByte_leftOverData() {
+ val schemaFile =
Util.daffodilPath("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/bits_parsing.dfdl.xsd")
+ val testSchemaFile = if (Util.isWindows) Util.cmdConvert(schemaFile) else
schemaFile
+ val shell = Util.start("", true)
+
+ try {
+ val cmd = String.format("echo -n stri| %s parse -s %s -r leastFirst",
Util.binPath, testSchemaFile)
+ shell.sendLine(cmd)
+ shell.expect(contains("Left over data. Consumed 10 bit(s) with at least
16 bit(s) remaining."
+ + "\nLeft over data (Hex) at byte 2 is: (0b011101xx)"
Review comment:
Changes made
----------------------------------------------------------------
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