Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
whonore committed Dec 13, 2021
1 parent ba0ade2 commit cd72448
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test-shunting-yard.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ static void test_modulus()
ASSERT_RESULT("5 %5", 0);
}

static void test_negation()
{
ASSERT_RESULT("-1", -1);
ASSERT_RESULT("(-1)", -1);
ASSERT_RESULT("(-1) + 1", 0);
ASSERT_RESULT("(-1) + (-1)", -2);
ASSERT_RESULT("-1 + -1", -2);
ASSERT_RESULT("-1 + --1", 0);
}


static void test_functions()
{
Expand Down

0 comments on commit cd72448

Please sign in to comment.