From: Christopher L. Conway Date: Thu, 6 May 2010 20:08:00 +0000 (+0000) Subject: Adding tests for Integer::pow X-Git-Tag: cvc5-1.0.0~9072 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7e4f9c4af64e669db9df5cd13524b1ab3e47379;p=cvc5.git Adding tests for Integer::pow --- diff --git a/test/unit/util/integer_black.h b/test/unit/util/integer_black.h index c09db2207..8b8faf895 100644 --- a/test/unit/util/integer_black.h +++ b/test/unit/util/integer_black.h @@ -273,4 +273,16 @@ public: TS_ASSERT_EQUALS(res, large.toString()); } + void testPow() { + TS_ASSERT_EQUALS( Integer(1), Integer(1).pow(0) ); + TS_ASSERT_EQUALS( Integer(1), Integer(5).pow(0) ); + TS_ASSERT_EQUALS( Integer(1), Integer(-1).pow(0) ); + TS_ASSERT_EQUALS( Integer(0), Integer(0).pow(1) ); + TS_ASSERT_EQUALS( Integer(5), Integer(5).pow(1) ); + TS_ASSERT_EQUALS( Integer(-5), Integer(-5).pow(1) ); + TS_ASSERT_EQUALS( Integer(16), Integer(2).pow(4) ); + TS_ASSERT_EQUALS( Integer(16), Integer(-2).pow(4) ); + TS_ASSERT_EQUALS( Integer(1000), Integer(10).pow(3) ); + TS_ASSERT_EQUALS( Integer(-1000), Integer(-10).pow(3) ); + } };