Add integration tests for nested arithmetic
This commit is contained in:
@@ -40,9 +40,16 @@ static void test_unnested_arithmetic(void)
|
||||
TEST_ASSERT_EQUAL_STRING("64", read_eval_print("(- 100 36)"));
|
||||
}
|
||||
|
||||
static void test_nested_arithmetic(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_STRING("20", read_eval_print("(+ 1 (* 2 (+ 3 4)) 5)"));
|
||||
TEST_ASSERT_EQUAL_STRING("-6", read_eval_print("(+ 1 (* 2 2 (- 3)) 5)"));
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(test_unnested_arithmetic);
|
||||
RUN_TEST(test_nested_arithmetic);
|
||||
return UNITY_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user