Add a test for BigInteger::operator<<

This commit is contained in:
abolz 2018-06-16 13:43:28 +02:00
parent a0f9c5fc46
commit 179277817d

View File

@ -120,6 +120,11 @@ TEST(BigInteger, LeftShift) {
EXPECT_TRUE(BIGINTEGER_LITERAL("4537899042132549697536") == a); EXPECT_TRUE(BIGINTEGER_LITERAL("4537899042132549697536") == a);
a <<= 99; a <<= 99;
EXPECT_TRUE(BIGINTEGER_LITERAL("2876235222267216943024851750785644982682875244576768") == a); EXPECT_TRUE(BIGINTEGER_LITERAL("2876235222267216943024851750785644982682875244576768") == a);
a = 1;
a <<= 64; // a.count_ != 1
a <<= 256; // interShift == 0
EXPECT_TRUE(BIGINTEGER_LITERAL("2135987035920910082395021706169552114602704522356652769947041607822219725780640550022962086936576") == a);
} }
TEST(BigInteger, Compare) { TEST(BigInteger, Compare) {