[squeak-dev] The Trunk: SUnit-nice.69.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Oct 19 21:23:54 UTC 2009


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

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

Name: SUnit-nice.69
Author: nice
Time: 19 October 2009, 9:23:50 am
UUID: 5e2aed9c-86b0-d940-b38e-9ceb40bbcdf7
Ancestors: SUnit-ar.68

remove uncessary sends of #values
because (aDictionary values do:) is same as (aDictionary do:)
except when aDictionary is modified in the do loop.

=============== Diff against SUnit-ar.68 ===============

Item was changed:
  ----- Method: TestCase class>>coverageForClass:until: (in category 'coverage') -----
  coverageForClass: cls until: aRootClass
  	"returns the test coverage of all the methods included inherited ones but stopping at aRootClass included"
  	
  	| definedMethods testedMethods untestedMethods |
  	definedMethods := cls allSelectorsAboveUntil: aRootClass.
  	definedMethods size = 0
  		ifTrue: [^ {0. Set new}].
  	testedMethods := 
+ 		self methodDictionary inject: Set new into: 
- 		self methodDictionary values inject: Set new into: 
  							[:sums :cm | sums union: cm messages].
  	testedMethods := testedMethods reject: [:sel | (definedMethods includes: sel) not].
  	untestedMethods := definedMethods select: [:selector | (testedMethods includes: selector) not].
  	^ { (testedMethods size * 100 / definedMethods size) asFloat . untestedMethods}
  !

Item was changed:
  ----- Method: TestCase class>>localCoverageForClass: (in category 'coverage') -----
  localCoverageForClass: cls
  	
  	| definedMethods testedMethods untestedMethods |
  	definedMethods := cls selectors.
  	"It happens for IdentityBag / IdentityBagTest"
  	definedMethods size = 0
  		ifTrue: [^ {0. Set new}].
  
  	testedMethods := 
+ 		self methodDictionary inject: Set new into: 
- 		self methodDictionary values inject: Set new into: 
  							[:sums :cm | sums union: cm messages].
  					
  	"testedMethods contains all the methods send in test methods, which probably contains methods that have nothign to do with collection"
  	testedMethods := testedMethods reject: [:sel | (definedMethods includes: sel) not].
  
  	untestedMethods := definedMethods select: [:selector | (testedMethods includes: selector) not].
  
  	^ { (testedMethods size * 100 / definedMethods size) asFloat . untestedMethods}
  !




More information about the Squeak-dev mailing list