diff --git a/tests/integration_tests.c b/tests/integration_tests.c index d53d03e..0781ef8 100644 --- a/tests/integration_tests.c +++ b/tests/integration_tests.c @@ -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(); }