@Test
public void testCompile_VarLengthByteArrayInStructure() throws Exception {

  final JBBPCompiledBlock block = JBBPCompiler.compile("out { int len; some {byte [len] HeLLo;} }");
  final byte[] compiled = block.getCompiledData();
  assertEquals(9, compiled.length);
  assertEquals(JBBPCompiler.CODE_STRUCT_START | JBBPCompiler.FLAG_NAMED, compiled[0]);
  assertEquals(JBBPCompiler.CODE_INT | JBBPCompiler.FLAG_NAMED, compiled[1] & 0xFF);
  assertEquals(JBBPCompiler.CODE_STRUCT_START | JBBPCompiler.FLAG_NAMED, compiled[2]);
  assertEquals(JBBPCompiler.CODE_BYTE | JBBPCompiler.FLAG_NAMED | JBBPCompiler.FLAG_ARRAY | JBBPCompiler.FLAG_WIDE, compiled[3] & 0xFF);
  assertEquals(JBBPCompiler.EXT_FLAG_EXPRESSION_OR_WHOLESTREAM, compiled[4] & 0xFF);
  assertEquals(JBBPCompiler.CODE_STRUCT_END, compiled[5]);
  assertEquals(2, compiled[6]);
  assertEquals(JBBPCompiler.CODE_STRUCT_END, compiled[7]);
  assertEquals(0, compiled[8]);
  assertEquals(4, block.getNamedFields().length);
  assertEquals("out", block.getNamedFields()[0].getFieldPath());
  assertEquals("out.len", block.getNamedFields()[1].getFieldPath());
  assertEquals("out.some", block.getNamedFields()[2].getFieldPath());
  assertEquals("out.some.hello", block.getNamedFields()[3].getFieldPath());
}