Beispiel #1
0
std::tuple<metashell::mdb_command, std::string>
get_command_from_map(const metashell::mdb_command_handler_map& map,
                     const std::string& line)
{
  auto opt_pair = map.get_command_for_line(line);

  JUST_ASSERT(bool(opt_pair));

  return *opt_pair;
}
Beispiel #2
0
std::string get_output(const std::string& input_, const std::string& test_code_)
{
  test_shell sh;
  if (!test_code_.empty())
  {
    const bool r = sh.store_in_buffer(test_code_);
    JUST_ASSERT(r);
  }
  sh.line_available(input_);
  JUST_ASSERT_EQUAL("", sh.info());
  JUST_ASSERT_EQUAL("", sh.error());
  return sh.output();
}