[Pkg] The Trunk: Tests-cmm.60.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 15 17:16:55 UTC 2010


Chris Muller uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-cmm.60.mcz

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

Name: Tests-cmm.60
Author: cmm
Time: 15 March 2010, 12:16:40.801 pm
UUID: 72fd6c76-14cd-4caf-a895-56f87e57e171
Ancestors: Tests-cmm.59

Moved comments in testReadIntoStartingAtCount.

=============== Diff against Tests-cmm.59 ===============

Item was changed:
  ----- Method: FileStreamTest>>testReadIntoStartingAtCount (in category 'as yet unclassified') -----
  testReadIntoStartingAtCount
  	| filename file |
  	filename := 'filestream.tst'.
  	[ | writeBuffer readBuffer bytesRead |
  	writeBuffer := (ByteArray new: 2500)
  		 atAllPut: 1 ;
  		 yourself.
  	(StandardFileStream forceNewFileNamed: filename)
  		 binary ;
  		 nextPutAll: writeBuffer ;
  		 close.
  	file := StandardFileStream readOnlyFileNamed: filename.
  	readBuffer := ByteArray new: 400.
  	bytesRead := file
  		readInto: readBuffer
  		startingAt: 10
  		count: 100.
- 	"quick test"
  	self assert: bytesRead = 100.
+ 	"quick test"
- 	"compare test"
  	self assert: (bytesRead occurrencesOf: 1) = 100.
+ 	"compare test"
  	1 to: readBuffer size do:
  		[ : n | self assert:
  			((readBuffer at: n) = (n between: 10 	and: 10 + 100)
  				ifTrue: [ (writeBuffer at: n) ]
  				ifFalse: [ 0 ]) ] ]
  	ensure:
  		[ file ifNotNil: [ file close ].
  		FileDirectory default
  			deleteFileNamed: filename
  			ifAbsent: [ "ok" ] ]!



More information about the Packages mailing list