Added parse builtin for testing. Lots of work on simulated execution.

This commit is contained in:
ridiculousfish
2013-06-15 14:32:38 -07:00
parent e2a506e54a
commit 827a9d640c
5 changed files with 295 additions and 53 deletions

View File

@@ -1722,8 +1722,16 @@ void history_tests_t::test_history_speed(void)
static void test_new_parser(void)
{
say(L"Testing new parser!");
const wcstring src = L"echo hello world";
parse_node_tree_t parse_tree;
parse_t parser;
parser.parse(L"echo hello");
parser.parse(src, &parse_tree);
parse_execution_context_t ctx(parse_tree, src);
say(L"Simulating execution:");
wcstring simulation = ctx.simulate();
printf("%ls\n", simulation.c_str());
}
/**