# [Pkg] The Trunk: KernelTests-nice.240.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jan 9 01:33:14 UTC 2013

```Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.240.mcz

==================== Summary ====================

Name: KernelTests-nice.240
Author: nice
Time: 9 January 2013, 2:32:42.972 am
UUID: f87fed9a-50d1-4818-a528-909cccb455f6
Ancestors: KernelTests-nice.238

Test expectations of Euclidean division with quotient rounded toward zero (quo: rem:) or toward negative infinity (// \\) for various range of Integer.

=============== Diff against KernelTests-nice.238 ===============

+ ----- Method: IntegerTest>>testIntegerDivision (in category 'testing - arithmetic') -----
+ testIntegerDivision
+ 	| suite |
+ 	suite := #( 1 2 5 1000 123456798  111222333444555 987654321098765432109876 ).
+ 	suite := suite , (suite collect: [:e | e negated]).
+ 	suite do: [:a |
+ 		suite do: [:b |
+ 			| q r |
+ 			q := a // b.
+ 			r := a \\ b.
+ 			self assert: b * q + r = a.
+ 			self assert: r abs < b abs.
+ 			self assert: (r isZero or: [b negative = r negative])]].!

+ ----- Method: IntegerTest>>testQuoRem (in category 'testing - arithmetic') -----
+ testQuoRem
+ 	| suite |
+ 	suite := #( 1 2 5 1000 123456798 111222333444555 987654321098765432109876 ).
+ 	suite := suite , (suite collect: [:e | e negated]).
+ 	suite do: [:a |
+ 		suite do: [:b |
+ 			| q r |
+ 			q := a quo: b.
+ 			r := a rem: b.
+ 			self assert: b * q + r = a.
+ 			self assert: r abs < b abs.
+ 			self assert: (r isZero or: [a negative = r negative])]].!

```