message: Add tests for parsing import section
diff: #include "parser.hpp"
  #include "utils.hpp"
  #include <gtest/gtest.h>
  +#include <types.hpp>
  using namespace fizzy;
  @@ -192,6 +193,45 @@ TEST(parser, type_section_with_multiple_functypes)
  EXPECT_EQ(module.codesec.size(), 0);
  }
  +TEST(parser, import_single_function)
  +{
  + const auto section_contents = bytes{0x01, 0x03, 'm', 'o', 'd', 0x03, 'f', 'o', 'o', 0x00, 0x42};
  + const auto bin =
  + bytes{wasm_prefix} + uint8_t{0x02} + uint8_t(section_contents.size()) + section_contents;
  +
  + const auto module = parse(bin);
  + ASSERT_EQ(module.importsec.size(), 1);
  + EXPECT_EQ(module.importsec[0].module, "mod");
  + EXPECT_EQ(module.importsec[0].name, "foo");
  + EXPECT_EQ(module.importsec[0].kind, ImportKind::Function);
  + EXPECT_EQ(module.importsec[0].desc.function_type_index, 0x42);
  +}
  +
  +TEST(parser, import_multiple)
  +{
  + const auto section_contents =
  + bytes{0x03, 0x02, 'm', '1', 0x03, 'a', 'b', 'c', 0x00, 0x42, 0x02, 'm', '2', 0x03, 'f', 'o',
  + 'o', 0x02, 0x00, 0x7f, 0x02, 'm', '3', 0x03, 'b', 'a', 'r', 0x03, 0x7f, 0x00};
  + const auto bin =
  + bytes{wasm_prefix} + uint8_t{0x02} + uint8_t(section_contents.size()) + section_contents;
  +
  + const auto module = parse(bin);
  + ASSERT_EQ(module.importsec.size(), 3);
  + EXPECT_EQ(module.importsec[0].module, "m1");
  + EXPECT_EQ(module.importsec[0].name, "abc");
  + EXPECT_EQ(module.importsec[0].kind, ImportKind::Function);
  + EXPECT_EQ(module.importsec[0].desc.function_type_index, 0x42);
  + EXPECT_EQ(module.importsec[1].module, "m2");
  + EXPECT_EQ(module.importsec[1].name, "foo");
  + EXPECT_EQ(module.importsec[1].kind, ImportKind::Memory);
  + EXPECT_EQ(module.importsec[1].desc.memory.limits.min, 0x7f);
  + EXPECT_FALSE(module.importsec[1].desc.memory.limits.max);
  + EXPECT_EQ(module.importsec[2].module, "m3");
  + EXPECT_EQ(module.importsec[2].name, "bar");
  + EXPECT_EQ(module.importsec[2].kind, ImportKind::Global);
  + EXPECT_FALSE(module.importsec[2].desc.global_mutable);
  +}
  +
  TEST(parser, function_section_with_single_function)
  {
  const auto section_contents = bytes{0x01, 0x0};
  