[squeak-dev] The Trunk: KernelTests-ul.111.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Nov 25 05:44:48 UTC 2009


Andreas Raab uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-ul.111.mcz

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

Name: KernelTests-ul.111
Author: ul
Time: 25 November 2009, 3:03:32 am
UUID: 2c216e45-0ea1-a24b-993b-13475da09193
Ancestors: KernelTests-ul.110

- updated tests for Kerner-ul.305

=============== Diff against KernelTests-ul.110 ===============

Item was changed:
  ----- Method: IntegerTest>>testIsPrime (in category 'tests - basic') -----
  testIsPrime
  
+ 	"Not primes:"
+ 	#(-100 -5 -3 -2 -1 0 1) do: [ :each |
+ 		self deny: each isPrime ].
+ 
  	"The following tests should return 'true'"
+ 	#(17 78901 104729 15485863 2038074743) do: [ :each |
+ 		self assert: each isPrime ].
- 	self assert: 17 isPrime.
- 	self assert: 78901 isPrime.
- 	self assert: 104729 isPrime.
- 	self assert: 15485863 isPrime.
- 	self assert: 2038074743 isPrime.
- 	self assert: 29996224275833 isPrime.
  	
  	"The following tests should return 'false' (first 5 are Carmichael integers)"
+ 	#(561 2821 6601 10585 15841 256 29996224275831) do: [ :each |
+ 		self deny: each isPrime ].!
- 	self deny: 561 isPrime.
- 	self deny: 2821 isPrime.
- 	self deny: 6601 isPrime.
- 	self deny: 10585 isPrime.
- 	self deny: 15841 isPrime.
- 	self deny: 256 isPrime.
- 	self deny: 29996224275831 isPrime.!

Item was added:
+ ----- Method: IntegerTest>>testIsProbablyPrime (in category 'tests - basic') -----
+ testIsProbablyPrime
+ 
+ 	"Not primes:"
+ 	#(-100 -5 -3 -2 -1 0 1) do: [ :each |
+ 		self deny: each isProbablyPrime ].
+ 
+ 	"The following tests should return 'true'"
+ 	#(17 78901 104729 15485863 2038074743 29996224275833) do: [ :each |
+ 		self assert: each isProbablyPrime ].
+ 	
+ 	"The following tests should return 'false' (first 5 are Carmichael integers)"
+ 	#(561 2821 6601 10585 15841 256 29996224275831) do: [ :each |
+ 		self deny: each isProbablyPrime ].!

Item was added:
+ ----- Method: IntegerTest>>testSqrtFloor (in category 'tests - mathematical functions') -----
+ testSqrtFloor
+ 
+ 	#(-1234567890123 -10 -5 -1) do: [ :each |
+ 		self should: [ each sqrtFloor ] raise: Error ].
+ 	#(
+ 		0 1 2 3 4 5 10 16 30 160479924 386234481 501619156 524723498 580855366 766098594 834165249 1020363860 1042083924 1049218924
+ 		1459774772895569 3050005981408238 4856589481837079 5650488387708463 7831037396100244) do: [ :each |
+ 			self assert: each asFloat sqrt floor = each sqrtFloor ]
+ 		!




More information about the Squeak-dev mailing list