Exemple #1
0
TEST_F(DonutParserTest, BasicCheckTest)
{
	Handler<Source> code = Parser::fromString("test=1;", "<MEM>", 0)->parseProgram();
	ASSERT_EQ(1, code->numClosure());
	Handler<Closure> clos = code->getEntrypoint();

	ASSERT_EQ(0, clos->arglist().size());
	ASSERT_LE(0, clos->instlist().size());
}
Exemple #2
0
TEST_F(DonutParserTest, DotTest)
{
	Handler<Source> code = Parser::fromString("func(zux){test.aux=1;};", "<MEM>", 0)->parseProgram();
	ASSERT_EQ(2, code->numClosure());
	Handler<Closure> clos = code->getEntrypoint();

	ASSERT_EQ(0, clos->arglist().size());
	ASSERT_LT(0, clos->instlist().size());

	Handler<Closure> another = code->getClosure((code->getEntrypointID()+1)%2);
	ASSERT_EQ(1, another->arglist().size());
	ASSERT_LT(0, another->instlist().size());
}