RegressionTests__IntegerTest.st
changeset 6 2df53bc27c65
parent 5 f100f290c769
child 7 7341cc740119
equal deleted inserted replaced
5:f100f290c769 6:2df53bc27c65
    89     ].
    89     ].
    90 
    90 
    91     "arithmetic overFlow checks"
    91     "arithmetic overFlow checks"
    92 
    92 
    93 "/    self test:[(maxVal + 1) inspect.maxValPlus1 inspect. true].
    93 "/    self test:[(maxVal + 1) inspect.maxValPlus1 inspect. true].
    94     self test:[maxVal + 1 = maxValPlus1].
    94     self test:[(maxVal perform:'+' asSymbol with:1) = maxValPlus1].
    95     self test:[minVal - 1 = minValMinus1].
    95     self test:[(maxVal + 1) = maxValPlus1].
    96 
    96     self test:[(minVal perform:'-' asSymbol with:1) = minValMinus1].
       
    97     self test:[(minVal - 1) = minValMinus1].
       
    98 
       
    99     self test:[(halfMax perform:'+' asSymbol with:halfMax) = maxValPlus1].
    97     self test:[(halfMax + halfMax) = maxValPlus1].
   100     self test:[(halfMax + halfMax) = maxValPlus1].
       
   101     self test:[(halfMin perform:'+' asSymbol with:halfMin) == minVal].
    98     self test:[(halfMin + halfMin) == minVal].
   102     self test:[(halfMin + halfMin) == minVal].
       
   103     self test:[(halfMax perform:'*' asSymbol with:2) = maxValPlus1].
    99     self test:[(halfMax * 2) = maxValPlus1].
   104     self test:[(halfMax * 2) = maxValPlus1].
       
   105     self test:[(halfMin perform:'*' asSymbol with:2) == minVal].
   100     self test:[(halfMin * 2) == minVal].
   106     self test:[(halfMin * 2) == minVal].
   101     self test:[maxValPlus1 // 2 == halfMax].
   107     self test:[(maxValPlus1 perform:'//' asSymbol with:2) == halfMax].
       
   108     self test:[(maxValPlus1 // 2) == halfMax].
       
   109     self test:[(halfMax perform:'bitShift:' asSymbol with:1) = maxValPlus1].
       
   110     self test:[(halfMin perform:'bitShift:' asSymbol with:1) == minVal].
   102     self test:[(halfMax bitShift:1) = maxValPlus1].
   111     self test:[(halfMax bitShift:1) = maxValPlus1].
   103     self test:[(halfMin bitShift:1) == minVal].
   112     self test:[(halfMin bitShift:1) == minVal].
   104 
   113 
   105     "LargeInt op -> SmallInt result"
   114     "LargeInt op -> SmallInt result"
   106     t := maxVal + 1.
   115     t := maxVal + 1.