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

commits at source.squeak.org commits at source.squeak.org
Tue Oct 20 20:09:17 UTC 2009


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

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

Name: SUnit-nice.70
Author: nice
Time: 20 October 2009, 10:09:02 am
UUID: ccabb0e3-9e9e-4c97-871d-630b61d373da
Ancestors: SUnit-nice.69

Track #selectors usage, and #keys usage, use #asSet where due

=============== Diff against SUnit-nice.69 ===============

Item was changed:
  ----- Method: ClassFactoryForTestCaseTest>>testSingleClassCreation (in category 'testing') -----
  testSingleClassCreation
  	|class elementsInCategoryForTest |
  	class := factory 
  		newSubclassOf: Object 
  		instanceVariableNames: 'a b c' 
  		classVariableNames: 'X Y'.
  	self assert: (SystemNavigation new allClasses includes: class).
  	elementsInCategoryForTest := SystemOrganization listAtCategoryNamed: factory defaultCategory. 
  	self assert: elementsInCategoryForTest = {class name}.
  	self assert: class instVarNames = #(a b c).
+ 	self assert: class classPool keys asSet = #(X Y) asSet!
- 	self assert: class classPool keys = #(X Y) asSet!

Item was changed:
  ----- Method: TestCase class>>localCoverageForClass: (in category 'coverage') -----
  localCoverageForClass: cls
  	
  	| definedMethods testedMethods untestedMethods |
+ 	definedMethods := cls selectors asSet.
- 	definedMethods := cls selectors.
  	"It happens for IdentityBag / IdentityBagTest"
  	definedMethods size = 0
  		ifTrue: [^ {0. Set new}].
  
  	testedMethods := 
  		self methodDictionary 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