Add more C4Script tests

This time exercising some code I managed to break by adding more
optimizations.
liquid_container
Günther Brammer 2016-02-02 02:10:40 +01:00
parent 1e8dafd75d
commit c444f85bae
1 changed files with 6 additions and 0 deletions

View File

@ -123,3 +123,9 @@ TEST_F(AulTest, Eval)
EXPECT_EQ(C4VInt(42), RunCode("local i = 42; func Main() { return eval(\"this.i\"); }", false));
EXPECT_EQ(C4VInt(42), RunCode("local i; func Main() { eval(\"this.i = 42\"); return i; }", false));
}
TEST_F(AulTest, Vars)
{
EXPECT_EQ(C4VInt(42), RunCode("var i = 21; i = i + i; return i;"));
EXPECT_EQ(C4VInt(42), RunCode("var i = -42; i = Abs(i); return i;"));
}