#FEATURE by sr
class: RegressionTests::IntegerTest
added:
#doNegate:
#testNegation
--- a/RegressionTests__IntegerTest.st Thu Oct 12 16:25:29 2017 +0200
+++ b/RegressionTests__IntegerTest.st Thu Oct 12 17:16:05 2017 +0200
@@ -697,6 +697,10 @@
"
!
+doNegate:aNumber
+ ^ aNumber negated
+!
+
doTestAll
"general conversion & arithmetic tests.
Notice, the arithmetic tests are both performed via regular sends
@@ -4147,6 +4151,11 @@
"
!
+testNegation
+ self assert:(self doNegate:SmallInteger minVal) class = LargeInteger.
+ self assert:(self doNegate:SmallInteger minVal) = (SmallInteger maxVal + 1).
+!
+
testNextPowerOfTwo
"/ self assert:(0 nextPowerOf2 = 0).
self assert:(1 nextPowerOf2 = 1).