message: Add test to parse br_table with empty vector
diff: @@ -712,3 +712,29 @@ TEST(parser, instr_br_table)
  "04000000"_bytes;
  EXPECT_EQ(code.immediates.substr(br_table_imm_offset, expected_br_imm.size()), expected_br_imm);
  }
  +
  +TEST(parser, instr_br_table_empty_vector)
  +{
  + /*
  + (block
  + (br_table 0 (get_local 0))
  + (return (i32.const 99))
  + )
  + (i32.const 100)
  + */
  +
  + const auto code_bin = "024020000e000041e3000f0b41e4000b000c046e616d6502050100010000"_bytes;
  +
  + const auto [code, pos] = parse_expr(code_bin.data());
  +
  + EXPECT_EQ(code.instructions,
  + (std::vector{Instr::block, Instr::local_get, Instr::br_table, Instr::i32_const,
  + Instr::return_, Instr::end, Instr::i32_const, Instr::end}));
  +
  + // blocks + local_get before br_table
  + const auto br_table_imm_offset = 1 + 2 * 4 + 4;
  + const auto expected_br_imm =
  + "00000000"
  + "00000000"_bytes;
  + EXPECT_EQ(code.immediates.substr(br_table_imm_offset, expected_br_imm.size()), expected_br_imm);
  +}
  