[squeak-dev] The Trunk: TraitsTests-ar.8.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Mar 30 03:59:11 UTC 2010


Andreas Raab uploaded a new version of TraitsTests to project The Trunk:
http://source.squeak.org/trunk/TraitsTests-ar.8.mcz

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

Name: TraitsTests-ar.8
Author: ar
Time: 29 March 2010, 8:58:51.65 pm
UUID: a365e4f0-6365-a346-83f4-764ff185d2b8
Ancestors: TraitsTests-ul.7

Add a test for the behavior of traits during condenseChanges.

=============== Diff against TraitsTests-ul.7 ===============

Item was added:
+ ----- Method: TraitFileOutTest>>testCondenseChanges (in category 'testing') -----
+ testCondenseChanges
+ 	"Tests moveChangesTo: in the face of aliases and other trait manipulations"
+ 	| file classOrTrait originals copy |
+ 	file := FileStream forceNewFileNamed: 'TraitFileOutTest.changes'.
+ 	[originals := IdentityDictionary new.
+ 	#(t1 t2 t3 t4 t5 t6 c1 c2) do:[:clsName|
+ 		classOrTrait := self perform: clsName.
+ 		classOrTrait methodsDo:[:each|
+ 			originals at: each put: each getSourceFromFile.
+ 		].
+ 		file setToEnd.
+ 		classOrTrait moveChangesTo: file.
+ 		originals keysAndValuesDo:[:method :source| 
+ 			"we need the upfront assertion to avoid a current bug 
+ 			in #nextChunk when using out of bounds indexes"
+ 			self assert: method filePosition < file size.
+ 			copy := file position: method filePosition; nextChunkText.
+ 			self assert: copy = source.
+ 		].
+ 	].
+ 	] ensure:[
+ 		file close. 
+ 		FileDirectory default deleteFileNamed: file name ifAbsent:[].
+ 	].!




More information about the Squeak-dev mailing list