RegressionTests__IntegerTest.st
changeset 1833 5c67361eefeb
parent 1832 672ae0ade75c
child 1900 82127002ff24
--- a/RegressionTests__IntegerTest.st	Thu Oct 12 17:16:05 2017 +0200
+++ b/RegressionTests__IntegerTest.st	Thu Oct 12 17:21:43 2017 +0200
@@ -130,6 +130,18 @@
     "Modified: / 9.6.1999 / 16:54:02 / cg"
 !
 
+doNegate2:aNumber
+    |i "{ Class: SmallInteger }"|
+
+    i := aNumber.
+
+    ^ i negated
+!
+
+doNegate:aNumber
+    ^ aNumber negated
+!
+
 doPlus1_a:arg
     ^ arg + 1
 
@@ -697,10 +709,6 @@
     "
 !
 
-doNegate:aNumber
-    ^ aNumber negated
-!
-
 doTestAll
     "general conversion & arithmetic tests.
      Notice, the arithmetic tests are both performed via regular sends
@@ -4154,6 +4162,9 @@
 testNegation
     self assert:(self doNegate:SmallInteger minVal) class = LargeInteger.
     self assert:(self doNegate:SmallInteger minVal) = (SmallInteger maxVal + 1).
+
+    self assert:(self doNegate2:SmallInteger minVal) class = LargeInteger.
+    self assert:(self doNegate2:SmallInteger minVal) = (SmallInteger maxVal + 1).
 !
 
 testNextPowerOfTwo