Skip to content

Commit

Permalink
add subtraction tests for overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Herts committed May 21, 2024
1 parent 0b5e6c1 commit 898a2d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ TEST(BigInt_test, Subtraction_Tests)
bigint small_number = 9955;
bigint huge_number_1 = "123456789";
bigint huge_number_2 = "10000000000000000000";
bigint min_ll = LLONG_MIN;
ASSERT_EQ(bigint("30") - bigint("20"), "10");
ASSERT_EQ(small_number - 5, 9950);
ASSERT_EQ(small_number - small_number, 0);
ASSERT_EQ(min_ll - 1, bigint("-9223372036854775809"));
ASSERT_EQ(huge_number_1 - 1, "123456788");
ASSERT_EQ(huge_number_2 - 1, "9999999999999999999");
}
Expand Down

0 comments on commit 898a2d1

Please sign in to comment.